## 3 Results  
### Segmentation/Selection of the Machine Learning Algorithm and Attribute Subset  
For the selection of the most-suited machine learning algorithm, twelve classifiers were compared according to their MCC and time to build the ten-fold cross correlation model using default parameters in the software. For this purpose, a dataset of 20 labeled images based on all 141 attributes available in the Trainable WEKA Segmentation plug-in was evaluated (Supplementary Material Figure S1). Because the MCC value differed only slightly between all trees, it was decided to focus on those trees that perform pruning (Random, J48, and LMT), meaning that parts with little impact on classifying instances are removed. The resulting smaller tree that does not perfectly classify every pixel of the training set is less prone to overfitting. The J48 tree was selected for further evaluation as it is based on the C4.5 algorithm listed as one of the top ten algorithms in data mining [40].  
For selecting the best-suited attributes, the classifying power of each attribute was evaluated by measuring the information gain with respect to a class, using the WEKA InfoGainAttributeEval algorithm. The algorithm measures how each feature contributes to decreasing the overall entropy. Thereby, the value of an attribute is calculated as follows:  
\[\text{InfoGain(Class,Attribute)}=\text{H(Class)}-\text{H(Class }|\,\text{Attribute)}\]where H(Class) is the marginal entropy of the class and H(Class | Attribute) is the conditional entropy of the class with respect to the attribute. The InfoGainAttributeEval algorithm was chosen for attribute evaluation, since the previously selected ML algorithm J48 is based on the same principle of evaluating the worth of attributes for the classification process. Therefore, the InfoGainAttributeEval algorithm can be used to rank the attributes that are of value for the J48 algorithm. Based on the results in the ranking, attributes can be removed that would be cut off by the J48 pruning tree regardless. In this way, the process can be sped up by eliminating redundant attributes prior to the ML classification process. The resulting ranking, with the top-scoring 50 attributes, is shown in Table 1.  
Classifiers which are based on different subsets of attributes were compared according to their performance on three image tests sets (TS1: 67 images; TS2: 66 images; TS3: 66 images). The test sets were compared to manually classified images. The evaluation started with a test of a classifier considering the full range of image attributes for decision making. Each following classifier was simplified, whereby the subset with the lowest contribution to classifying power, calculated by the InfoGainAttributeEval algorithm, was removed, resulting in the eight classifiers shown in Figure 3. Filters used in the subset selection include entropy (ENT), variance (VAR), Hessian (HES), and Laplacian (LAP).  
All classification results were binarized into two classes: worm (=white (1)) and background (=black (0)). Quantitation was performed in FIJI using the Analyze Particles function and the following values were calculated: TP, FP, FN, TN, TPR, TNR, ACC, and the MCC. It could be observed that Subset 1, which uses 22 attributes based on entropy with a sigma range of 1-16 for decision making, led to a classifier that showed the highest ACC (94.56%), sensitivity (73.48%), specificity (96.63%), and MCC (67.99%), resulting in the best performance for the three test sets TS1-3 (Table 2, Figure 4). Performance is hereby calculated as mean of ACC, TPR, TNR, and MCC.