## 5 Results and Discussion
### Artificial Neural Network Model Results  
The results of the ML model implemented utilizing ANN to classify different soil types are presented here. Figure 6 displays the accuracy and loss of the ANN model for 200 epochs on both the training and validation data. At the beginning of the training, the model has a low accuracy of 0.79 and a high loss of 0.63 values, indicating that it cannot make good predictions. However, as training progresses, the accuracy improves, and the loss decreases, indicating that it gradually improves its ability to make more accurate predictions. When the validation accuracy and loss metrics improve, it suggests that the model is generalizing well to new data, which is a desirable outcome.  
Table 3 displays the confusion matrix of the ANN model, which provides insight into the model's performance on the test data. The rows correspond to the predicted values, while the columns correspond to the actual values. The diagonal elements of the confusion matrix represent the number of instances that the model correctly classified, while the off-diagonal elements correspond to the misclassifications made by the model.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Prediction**} & \multicolumn{6}{c}{**Actual**} \\ \cline{2-7}  & **2** & **3** & **4** & **5** & **6** & **7** \\ \hline
2 & 808 & 8 & 0 & 0 & 0 & 0 \\
3 & 31 & 1594 & 23 & 1 & 0 & 0 \\
4 & 0 & 63 & 13,708 & 69 & 0 & 0 \\
5 & 0 & 0 & 91 & 22,781 & 55 & 0 \\
6 & 0 & 0 & 0 & 62 & 4801 & 99 \\
7 & 0 & 0 & 0 & 1 & 20 & 202 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Artificial neural network confusion matrix.  
Statistics by class (Table 4) show that the model has a high sensitivity for all soil types except type 7, with a low sensitivity value of 0.67. Additionally, the model has a high specificity for all classes, with values ranging from 0.99 to 1.0.  
The positive predicted value (PPV) and negative predicted value (NPV) are important performance metrics in evaluating the effectiveness of a classifier. A high PPV indicates that it is likely correct when the model predicts a sample to belong to a particular class. On the other hand, a high NPV indicates that when the model predicts a sample to not belong to a particular class, it is likely to be correct. The ANN model results show a high PPV for all soil types, with values ranging from 0.91 to 0.99. Similarly, the NPV is high for all soil types, with values ranging from 0.99 to 1.  
In summary, the ANN model has an overall accuracy of 98.82%, showing that the model performs well in classification tasks. However, the model struggles to predict class 7 (minority class), given a low sensitivity value.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Performance Metrics** & **2** & **3** & **4** & **5** & **6** & **7** \\ \hline Sensitivity & 0.96 & 0.96 & 0.99 & 0.99 & 0.98 & 0.67 \\ Specificity & 1.00 & 1.00 & 1.00 & 0.99 & 1.00 & 1.00 \\ PPV & 0.99 & 0.97 & 0.99 & 0.99 & 0.97 & 0.91 \\ NPV & 1.00 & 1.00 & 1.00 & 0.99 & 1.00 & 1.00 \\ Prevalence & 0.02 & 0.04 & 0.31 & 0.52 & 0.11 & 0.01 \\ Detection Rate & 0.02 & 0.04 & 0.31 & 0.51 & 0.11 & 0.00 \\ Detection Prevalence & 0.02 & 0.04 & 0.31 & 0.52 & 0.11 & 0.01 \\ Balanced Accuracy & 0.98 & 0.98 & 0.99 & 0.99 & 0.99 & 0.84 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Class distribution summary for ANN model.  
Figure 6: Change in loss and accuracy over epochs for a neural network model.