Understanding of Trainable Weka Segmentation in Fiji
Posted by GuPInt on Oct 23, 2013; 12:29pm
URL: http://imagej.273.s1.nabble.com/Understanding-of-Trainable-Weka-Segmentation-in-Fiji-tp5005279.html
Hi list,
I'm using the Trainable Weka Segmentation from Fiji in one of my macros to segment round/oval objects from the background in images wich are typically about 1360x1024 pixels.
I trained the classifier and saved the datas and everything works perfectly automated now since the plugin is available with macro commands. BUT:
1) it lasts very long to apply a classifier on a testimage (about 20min). Is there a way to decrease the time needed for the separation? My algoritm looks like this:
for (i=0;i<list.length;i++) {
run("Trainable Weka Segmentation"); //is it needed to open the segmentation to apply a classifier?
call("trainableSegmentation.Weka_Segmentation.loadClassifier", ...);
call("trainableSegmentation.Weka_Segmentation.loadData", ...);
call("trainableSegmentation.Weka_Segmentation.setClassHomogenization", "true");
call("trainableSegmentation.Weka_Segmentation.setOpacity", "75");
call("trainableSegmentation.Weka_Segmentation.applyClassifier", directory, list[i], "showresults=true", "storeResults=true", "probabilityMaps=false", savedirectory);
}
I used the features: Gaussian blur, Sobel filter, Difference of gaussians, Membrane projections, Variance, Mean, Minimum, Maximum, Median, Anisotropic diffusion, Bilateral, Lipschitz, Laplacian, Neighbors
I know one reason that it is so slow is because I chose so many features but I wanted to get the best results and hopefully every object separated from the background and detected as object or is it senseless to chose many features to get reliable segmented images as results? (I go on working with those images automatically without manual corrections)
2) I want to understand how the Trainable Weka Segmentation decides whether one pixel is back- or foreground. As I learned so far the features of the input image are saved in a vector, one image is created for each feature and the classifier gets trained with those images. The classifier works with decision trees combined in a random forest. I understood the mathod of a decision tree but not how a random forest works in detail.
Additionally I didn't understand yet how the decisions are made in the single decision trees, i.e. the feature gaussian blur creates a gaussian blurred image of the original image and then? Does the algorithm detect some kind of value out of the gaussian blurred image during training and then when I apply the classifier compares it with the value of the gaussian blurred image of the input image? And does the random forest compare each pixel of it's training with the new input image I applied the classifier to or does it compare a special area of pixels? If it compares areas how are these defined?
So far the Trainable Weka Segmentation works perfectly but actually I don't want to use something although I don't understand how it works. At the moment it's just kind of a blackbox for me I know how to usw it but not how it really functions. Every other attempt to seperate those round/oval objects from the background failed so at the moment it's only possible for me to work with this plugin.
I hope someone can help me especially with the understanding on how the plugin functions.
Kind Regards