# Ontology with Deep Learning for Forest Image Classification
## 8 Experimental Results  
The aim of this study is to assess the effect of ontologies in the image classification task. With that in mind, the proposed ontology-based forest-type image classification model was compared against other baseline models such as random forest (RF), K-nearest neighbor (KNN), SVM, and Gaussian naive Bayes. The features extracted using an ensemble of deep learning models were used to train the classifiers based on an ontology that describes taxonomic relationships between image classes. For a particular test image, the classification task was performed both by the hypernym and hyponym classifiers. First, the classification process began by assigning the test image to the hyponym and hypernym classifiers with the highest confidence values. The hyponym and the hypernym classifiers ran in parallel. If there was a direct relationship between hypernym and hyponym classifiers, their confidence values were merged, and the test image was assigned to the best hyponym classier. If there was no relationship between the classifiers, the next best hyponym classifier was considered, and the same process repeats. The results presented in Table 5 show that the ontological bagging algorithm based on linear SVM outperformed other models with respect to RMSE and accuracy. The high accuracy is attributed to the ability of the model to suppress the error propagation of hierarchical classifiers. The results were further presented in terms of the confusion matrix and ROC curves. The confusion matrix for the kNN model is illustrated in Figure 7. It is shown that the kNN model absolutely managed to correctly classify all nineteen images for class 9. Similarly, the model correctly classified seventeen test images for classes 4 and 5, but class 5 \begin{table}
\begin{tabular}{l l l} \hline \hline
**Model** & **RMSE** & **Accuracy** \\ \hline kNN model & 1.530 & 0.816 \\ GaussianNB model & 1.678 & 0.638 \\ SVM model & 1.048 & 0.888 \\ RF model & 1.094 & 0.862 \\ Decision tree model & 2.090 & 0.625 \\
**Ontological bagging model** & **0.532** & **0.961** \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Accuracy and RMSE scores of the proposed model against baseline models such as kNN, GaussianNB, SVM, RF, and decision trees. received twelve more test images from classes 0, 1, 3, 4, and 5. The kNN performed poorly in classes 3 and 5, misclassifying seven and six test images into classes 1 and 2, respectively. The associated ROC curve for the kNN model in Figure 8 produced a perfect match for classes 7 and 4 by having an ROC AUC value of 1.0. In the corresponding confusion matrix of kNN, class 4 did not receive any false-positive test images, though two test images were misclassified into class 6. The confusion matrix of our ontological bagging approach in Figure 9 provides a better alternative to image classification, as evidenced by its ability to correctly classify all nineteen test images for classes 0, 4, 5, 6, and 7, despite the fact that class 5 received two additional test images from class 2. Only one test image was misclassified for classes 1 and 3. The corresponding ROC AUC curve (Figure 10) of our model produced a perfect match for classes 0, 3, 4, 5, and 7, i.e., the model managed to precisely distinguish between positive classes and negative classes. For all the classes, the model performed the worst for class 2, and this is consistent with the corresponding results from the confusion matrix, where four false-negative test images were recorded. Class 3 obtained a perfect match because one false-positive test image and one false-negative test image canceled each other out. In contrast to the confusion matrix results, class 5 did not produce a perfect match because there was an imbalance between false positives and false negatives, as the class received more false-negative test images than false-positive test images. Figure 8: ROC AUC Curves for kNN model-based classifier. Figure 7: kNN-based confusion matrix.