Posted by
Ignacio Arganda-Carreras on
Oct 23, 2013; 12:54pm
URL: http://imagej.273.s1.nabble.com/Understanding-of-Trainable-Weka-Segmentation-in-Fiji-tp5005279p5005320.html
Hello GuPint,
1) Given the size of your image, I would say the number of features is the
most likely cause of the computational time. Have you tried using less or
smaller features?
2) The features you select are filters that are applied to the original
image (with different radius depending on the parameters you choose in the
Settings dialog). Each pixel of your training traces is then represented as
a feature vector (formed by the pixel value of the original image at that
position and the pixel values of the filtered versions of the image at the
same position). Once you have the vectors, you can train any standard
learning algorithm to classify between the existing classes (foreground and
background in your case). By default, Trainable Weka Segmentation uses a
random forest (
http://en.wikipedia.org/wiki/Random_forest). In brief, a
random forest is a set of N random trees, which are decision trees in which
the decision of each node are taken based on M random-selected features. N
and M are parameters of the method. If you prefer to use another method you
feel more comfortable with, you can select it in the Settings dialog.
I hope this helps!
ignacio
> 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
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Understanding-of-Trainable-Weka-Segmentation-in-Fiji-tp5005279.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
Ignacio Arganda-Carreras, Ph.D.
Seung's lab, 46-5065
Department of Brain and Cognitive Sciences
Massachusetts Institute of Technology
43 Vassar St.
Cambridge, MA 02139
USA
Phone: (001) 617-324-3747
Website:
http://bioweb.cnb.csic.es/~iarganda/index_EN.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html