-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with transfer of classification from stack to images #63
Comments
I've done some troubleshooting. My current working hypothesis is that the Gabor training feature is not compatible with stack training for single image classification. As before, I've trained on the large stack with the same training features - excluding Gabor! Here's the probability map for the first image of the stack: And here's the probability map for the same image extracted from the stack: The probability maps are identical. Here's the difference (all pixels have a value of 0.0): IMHO a word of warning might be helpful for users using reading the Trainable Weka Segmentation Plugin documentation: Is this issue known or even by design? I'm not experienced enough with the feature implementation... |
Thanks, @christianrickert for reporting! This looks definitely like a bug in the calculation of the Gabor filters. I'll have a look and be back to you! |
Thanks for looking into this issue @iarganda. Happy Easter Monday! |
Dear @christianrickert, Sorry for the late replay. I haven't been able to reproduce the error using my own images (and the link to yours has expired)... ignacio |
@iarganda No worries, - I've uploaded the TIF again: nu-stack.tif (MD5: 42B925923D8C7CE34453416A7C19F78A) |
@christianrickert I'm still unable to reproduce the error. Here is what I've done:
Is there anything else you are doing? |
@iarganda Thanks for working on this issue! I think one of the issue with reproducibility might be that you used the Gabor feature only (I didn't). Let's make sure you can reproduce the issue first. Please run the script, point the dialog to the stack image and let the script produce the two probability maps. |
OK, I found the problem and it was not an easy one! When you have single slice, the features are calculated calling a multi-threaded method, while a single-threaded method is called for each slice if you have more than one. Usually there is no problem with that, but Gabor filters take some time and, in your case, the order of features in your final feature stack changes from one case to another... and WEKA classifiers don't like that :( I will add a method to reorder the feature stack when needed as soon as I can. |
Awesome work @iarganda! Out of curiosity: Would it be possible to continue using the multi-threaded function call (with all threads) for the stack and iterate through the stack one slice at a time with a fixed order? - In your proposed approach (as far as I understand the issue) the number of active threads would be limited by the number of available slices in a given stack. |
This should fix the following issue: #63
Major changes: * Fix Hessian eigenvalue calculation in FeatureStack. * Fix bug from issue #63.
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Hello, there's something curious about the transfer of my classification model from a training stack to my experimental dataset:
The probability map for the stack looks fine, but the probability map for a single image from the same stack looks different - using the same model for classification.
@iarganda suggested in a response to another issue to train on either a stack or on a sequence of images (for multiple images).
I've trained on a stack with 30 images depicting nuclei - using fairly computationally expensive features.
Here's the probability map for the first image of the stack:
And here's the probability map for the same image extracted from the stack:
The segmentation results for both images differ significantly, even though the same classification model has been used.
The macro below will create the probability maps for the training stack and then duplicate the first stack image and create the probability map with the same model for comparison: it takes roughly 25 min on my system with a peak memory usage of about 13.5 GB.
The files required for reproduction of the issue can be downloaded here: example.zip (MD5: EA367E1226010A1E14B3A1570DA2DD5F)
As a consequence, I can't train on a larger dataset to improve the segmentation results.
Any idea what went wrong with my approach or what I could do to prevent this issue in the future?
The text was updated successfully, but these errors were encountered: