Painting weka classes

Mainly to Ignacio (hola!), but perhaps others can make further suggestions.
In the Weka segmentation, the default brush size to define the classes samples is 1 pixel thick. I seem to remember that this was the only size supported when the plugin came out.
Has this been improved? Is there a way of painting the classes with a larger brush?
I am asking because it is painfullly slow and tedious to cover a large area that otherwise could be painted with a thicker brush and a few strokes. Or perhaps use polygons to define those areas?

Yes! You can use any of the available selection tools, including a thicker brush:

1 Like

In my experience, it is not necessary to cover large areas for training, and it might even slow down the process: to train a classifier, the features of the calculated feature stack are taken into account for each labeled pixel. Neighboring pixels often carry very similar information, and therefore adding pixels close to other already labeled pixels does not increase the quality of the classifier very much (and it blows up your data.arff file in case you want to save the labeled data).

It is often more helpful to only add very few more pixels in areas where the classifier doesn’t perform so well yet (where the uncertainty of the classifier is high). By using freehand lines, you keep the sample size small but still make sure to include the pixels representative of their class.

That said, if you still like to label/select arbitrary areas, I can very much recommend using the selection brush tool. Double-click on the tool button to set the brush size, then draw on the image. For modifying the selection, start brushing outside the selection to remove pixels, or inside the selection to add pixels.


Thanks for the prompt reply, guys, very happy to hear that it supports other selection tools and the selection brush tool is a good idea too (I keep forgetting about this!

1 Like