Trainable WEKA Segmentation "Could not apply Classifier" error after classifier load with Anisotropic Diff

Hello, as the title suggests, I am now having difficulty with the Trainable WEKA Segmentation plugin applying loaded classifiers. I can apply a classifier in the same session as I have created it without issue to hundreds of images, but once the classifier is saved and reopened, near the end of the normal processing time it stops and presents several “Could not apply Classifier” prompts and the following error:


WARNING: core mtj jar files are not available as resources to this classloader (sun.misc.Launcher$AppClassLoader@c387f44)

java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)

at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:7096)
at trainableSegmentation.WekaSegmentation$9.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Exception in thread “Thread-10” java.lang.NullPointerException
trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6763)
trainableSegmentation.WekaSegmentation$1ApplyClassifierThread.run(WekaSegmentation.java:5508)
at trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6763)
at trainableSegmentation.WekaSegmentation$1ApplyClassifierThread.run(WekaSegmentation.java:5508)
Exception in thread “Thread-9” java.lang.NullPointerException
trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:5566)
trainableSegmentation.Weka_Segmentation$1ImageProcessingThread.run(Weka_Segmentation.java:1860)
at trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:5566)
at trainableSegmentation.Weka_Segmentation$1ImageProcessingThread.run(Weka_Segmentation.java:1860)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.ArrayIndexOutOfBoundsException: 5
weka.core.DenseInstance.value(DenseInstance.java:347)
weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at weka.core.DenseInstance.value(DenseInstance.java:347)
at weka.core.AbstractInstance.isMissing(AbstractInstance.java:319)
at hr.irb.fastRandomForest.FastRandomTree.distributionForInstance(FastRandomTree.java:248)
at hr.irb.fastRandomForest.FastRfBagging.distributionForInstance(FastRfBagging.java:645)
at hr.irb.fastRandomForest.FastRandomForest.distributionForInstance(FastRandomForest.java:646)
at weka.classifiers.AbstractClassifier.classifyInstance(AbstractClassifier.java:173)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:7027)
at trainableSegmentation.WekaSegmentation$8.call(WekaSegmentation.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
java.lang.NullPointerException
trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6923)
trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6361)
trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6288)
trainableSegmentation.Weka_Segmentation.showClassificationImage(Weka_Segmentation.java:1581)
trainableSegmentation.Weka_Segmentation$1$1.run(Weka_Segmentation.java:387)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
at trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6923)
at trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6361)
at trainableSegmentation.WekaSegmentation.applyClassifier(WekaSegmentation.java:6288)
at trainableSegmentation.Weka_Segmentation.showClassificationImage(Weka_Segmentation.java:1581)
at trainableSegmentation.Weka_Segmentation$1$1.run(Weka_Segmentation.java:387)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


I am running Fiji with imagej v1.52p on Windows 10. This error seems to occur when Anisotropic Diffusion is included in the feature selection. Here is the log information from the failed run:


Loading Weka classifier from E:\Deepika NeuN\aniso_classifier_8_5_19.model…
Field of view: max sigma = 10.0, min sigma = 10.0
Membrane thickness: 1, patch size: 19
Read class name: class 1
Read class name: class 2
Field of view: max sigma = 10.0, min sigma = 10.0
Membrane thickness: 1, patch size: 19
Read class name: class 1
Read class name: class 2
Read header from E:\Deepika NeuN\aniso_classifier_8_5_19.model (number of attributes = 4)
Loaded E:\Deepika NeuN\aniso_classifier_8_5_19.model
Loading data from E:\Deepika NeuN\aniso_data_8_5_19.arff…
Loading data from E:\Deepika NeuN\aniso_data_8_5_19.arff…
Read class name: class 1
Read class name: class 2
Field of view: max sigma = 10.0, min sigma = 10.0
Membrane thickness: 1, patch size: 19
Read class name: class 1
Read class name: class 2
Loaded data: 1047 instances (4 attributes)
Creating feature stack…
Updating features of slice number 1…
Feature stack array is now updated (1 slice(s) with 1 features, took 1512ms).
Classifying whole image using 4 thread(s)…
Error while classifying whole image!
Finished segmentation of whole image.


I’ll also attach the settings of the run where I produced this error:

This is a great plugin and one I am hoping to build much of my graduate research around, but I am still learning much about image analysis and computer science in general, so I very much appreciate any input. Please let me know if there is more information that would be useful.

Thank you all for your time,
Theo Kataras