camicroscope / caMicroscope

Digital pathology image viewer with support for human/machine generated annotations and markups.
BSD 3-Clause "New" or "Revised" License
255 stars 295 forks source link

Something confusing about the predict function of caMicrosope #411

Closed 3048205169 closed 1 year ago

3048205169 commented 4 years ago

Describe the bug This maybe my mistake but actually there is problem. There is always a caveat that the value of input patch size that I typed in is incorrect.

I used to learn machine learning but I was not so familiar with the image processing. Thus, I thought maybe I have missed something very important.

To Reproduce Just type in information into the box.

Expected behavior I have no idea what will be right in the screen but I know Mine is wrong.

Desktop (please complete the following information):

Maybe someone could tell me what is the underlying mechanism of this function? (e.g. the model? the input? the output? the right way to use that model?)

3048205169 commented 4 years ago

uploading model model input

leoarc commented 4 years ago

caMicroscope uses tensorflow.js models for classification and segmentation . Some example models can be found here .

The input patch size is the size of patches on which the model was trained . For example , for this model the input patch size should be 512 , the classes should be benign, normal, insitu and invasive and the format should be RGB .

The normal workflow for uploading a model is something like :

Please let us know if there is any difficulty. Thank You.

3048205169 commented 4 years ago

Oh, I have missed the file that I have to upload!

3048205169 commented 4 years ago

caMicroscope uses tensorflow.js models for classification and segmentation . Some example models can be found here . The input patch size is the size of patches on which the model was trained . For example , for this model the input patch size should be 512 , the classes should be benign, normal, insitu and invasive and the format should be RGB . The normal workflow for uploading a model is something like :

fill in the details as mentioned above. Upload the tfjs model: The first upload is for the model.json file and the next one is for all the binaries. For the example above all files are present here . Once uploaded this is a guide that can help for using the Predict function .

Please let us know if there is any difficulty. Thank You.

models

birm commented 4 years ago

Thanks @leoarc for helping to handle this! @3048205169 has this answered your questions?

3048205169 commented 4 years ago

Thanks @leoarc for helping to handle this! @3048205169 has this answered your questions?

Yes! Althought I am not sure about the inner mechanism of the model, but I guess the calling of the classification is in the model.js.

I am not good at js, maybe I have to learn it.

birm commented 4 years ago

I'm afraid I don't quite understand. Are you asking about the model structure, or are you asking about the prediction application? (Or both?)

3048205169 commented 4 years ago

There are runPredict function in the model.js file which will call the model uploaded but I am not very good at .js file.

birm commented 4 years ago

I've added #413 to hopefully eventually help readability.

However, for now, I think you're looking for this line and the tf.tidy block it's in. Or maybe you're interested in model storage, which is done in browser.

birm commented 1 year ago

Closing as a stale issue. Feel free to reopen if you think this should be active still.