High-Country Ground Cover Segmentation


I have just discovered the TWS plugin in FIJI. I plan on using it to distinguish between bare ground (rock and soil), dead/unhealthy vegetation, and living/healthy vegetation in RGB digital photography images of country ground. I have about a thousand 4.6million pixel images to classify. The digital camera used isn’t the same for all images. Ultimately, I need the proportion of each class for each image.

The fast random forest seemed to perform a good segmentation for one of my images which has no shadow present.

The problem is that some images have dark shadows in them so I’m wondering what features will be necessary to perform accurate segmentation for these diverse images. I’ll attach some of them as an example. Some of my images are very similar because they are of the same location on a different date. The images uploaded show the diversity.

I also have a txt file of training data with rows: R,G,B, label of 200 samples for every image if that can somehow be imported into Weka to train a classifier (this would be ideal). Otherwise I can manually create training data myself. Also, do you have any specific model recommendations? I should I experiment.

Any advice would be greatly appreciated. Cheers, Sam.


I think you can import your data with the WEKA explorer, see:


However you have to try or ask @iarganda if the standardized WEKA import is possible or the TWS plugin works with a special ARFF format.

There is also an R plugin available to import or export WEKA data if you need a quick data transformation or want to perform the classification in R (for a TWS export if possible):


For a quick ransformation you can use dplyr:

For shadow removal maybe here you find some useful information (search for similar posts):

Probably you could include the shadows (vareity of shadows) in a seperate class to exclude the areas for analysis.


Just for completeness arff import in python:

Would love to see if TWS *arff data works in python, too.

Maybe the scikit-image(@jni) guys know more.


Thanks! Am trying to convert the txt file to arff at the moment. Also, How would I use my training data to compute all those extra features (from my R,G,B values for non-neighboring pixels) that TWS does automatically such as gaussian blur, sobel filter etc ?



If you need the extra features you have to create the training data in the TWS plugin which provides you with the different filters, etc. as an extra dimension to seperate the different classes in your images.

As I already noted I don’t know if it is possible to import existing training data as features into the TWS GUI.

In R or Python you can add those features programmatically when available (whereas the TWS plugin computes a great number of different features by default of course relevant only if they contribute to the classification process)


Thanks! Would you recommend the 2D or the 3D Trainable Weka Segmentation for these types of images?



1 Like

Since you have no 3D images, 2D should be fine. Then your trained classifier can be applied on all your images:


Dear @iarganda
Firstly, Thanks for you amazing TWS tool.

I would love if you can give some advice on which features you think might be best for my data above.

Structure, Entropy, Hue, Saturation, Anisotropic, Median, Max, Variance seem to be good but I haven’t got enough training data to properly test this and it takes 1-10 hours (depending on max sigma) to obtain all features for a given max sigma for ROI’s just for one image.

And, which sigma range would be good e.g 2:64, or 128 to 1000+ ?
I can send you a wider range of images if that would help.
I’m using binary masks to generate training data and also creating some of my own ROIs (very time consuming)

I have about a couple thousand images to classify (some are quite similar), but even If i just accurately classify 10 or 20 diverse images using the same model then I’ll be happy.


Sam Davidson

Sorry for my late answer. TWS allows you to load ARFF files containing the training data used on previous experiments using “Load data”. Those files are regular ARFF files created by TWS when clicking on “Save data”.

Hello @Sam_Davidson,

Sorry for my late reply!

You probably won’t need as many features as they are selected by default. Have a look at the recommendations we give in the manual (section 3.5) provided as supplementary material of the plugin publication.

That depends on the size of you objects. One idea would be to resize your images to a manageable size and start using small sigmas.

Sure, that sounds great. Send me some representative images and the expected segmentations and I will try to find you good features.