caMicroscope
caMicroscope copied to clipboard
Low correlation between the classification model loaded in caMicroscope and the model created in Python
I'm using caMicroscope to load a dataset containing images in JPEG format. I read in an old issue that this format is not allowed to load, so I converted each image to a TIFF pyramid with VIPS. After that, I was able to load and view images without problem. Also, I have a classification model loaded in caMicroscope, when I do the prediction for some reason, I get a different result with respect to the result obtained making the forward in a Python environment. Checking the patches extracted by the tool, I can see that are extracted wrong (you can see this in the attached image), or even it is as if it extracts a patch that does not correspond to the selected one.
The process has been:
- Load the image converted from JPG to TIFF pyramid into the viewer.
- Load the classification model and select the 'Predict' button.
- Select the region to predict.
- Pressing F12 key and 'Network'. In this part, we can visualize the result of each patch.
I expect that the model result loaded in caMicroscope coincides with the result of the Python model. I'm using Ubuntu 18.04 and Google Chrome.
Thanks for reporting! Is this something you're interested in taking a look at? No pressure, if not, we will :)
I have already checked, and I suspect the error is in extracting the patch or converting the JPG image to TIFF, but I am not sure.
The biggest symptom of bad VIPS conversion has been, in my experience, shifting as zoom levels change. That IIIF call's preview (thanks for including it) does look substantially worse than I'd expect even at that though.
Would you be able/willing to share the converted file? Also, if it's any help, here are the vips flags I've been using - https://github.com/camicroscope/SlideLoader/blob/122437a6dd038a5fe1b41ca07ef9d4567b2e1805/SlideServer.py#L73
Yes, I think the same. I'm going to try with the parameters you shared with me. To which email address could I send you the image?
you can use ryan.birmingham - at - dbmi.emory.edu
is the bug resolved? if not, i would like to make effort in the direction to solve it.
Indeed, the bug hasn't been resolved yet. We are still trying to make effort to solve it. Would you like to help us?
yupp.. i am already exploring the project, any suggestions where to start from?
@harry-dev98 I'm unsure if this is an issue with the vips conversion or the tile server (or both). A good first step would be to isolate which component is causing this issue.
That will load all the JPG image in the current directory, assemble them into a huge grid, 20 images across, and write as a TIFF pyramid. You'd need to check the size of your grid, obviously, and adjust the across parameter.
The $() part sorts the filenames of the form x_y.jpg by y first, then x, in numeric order. Without that, the tiles will be transposed, annoyingly.
That's assuming overlap 0. If your tiles have an overlap, you'll need to set the hspacing and vspacing options to control how tiles are positioned. For example: vips arrayjoin "$(ls *.jpg | sort -t_ -k2g -k1g)" x.tif --across 20 --hspacing 254 --vspacing 254
I did the conversion with VIPS array join and it works. RoI extraction and shifting as zoom levels change works. However, the regions to predict extracted by IIIF are still wrong. It extracts regions that don't match the selected region
has the issue been resolved yet? If not can someone guide me in the correct direction, I would like to help for the same.
I don't think this has been resolved. I'm still not confident if it's a vips or iip issue (or both).
I have some thoughts on how someone may investigate further: To test if it's vips, try the conversion a few different ways, and see if they all exhibit similar issues. To test if it's iip, try fetching different regions of a known good image using different protocols. From caMicroscope, the urls look something like http://localhost:4010/img/IIP/raw/?FIF=/images/sample.svs&WID=200&CVT=png
Thank you for your interest, and I hope this helps.