# A Lightweight Forest Test Image Recognition Model Based on Improved YOLOv8
## 4 Experiments
### Experiment Results  
#### 4.4.1 Comparison with YOLOv8  
To validate the effectiveness of the proposed network model, we conducted objective data comparative experiments and visual performance comparative experiments. The improved model was compared with the original YOLOv8 model.  
According to the results of objective data comparative experiments, as shown in Table 5, it can be observed that, compared to the original YOLOv8n model, the improved model in this study demonstrates superior detection accuracy, with a 1.5 percentage point increase in mAP, reaching a maximum AP of 99.5%. Furthermore, the improved model achieves a significant improvement in detection speed. Through the lightweight design of the neck component, the detection speed is increased by 13% compared to the original YOLOv8n model. In summary, the improved model in this study not only enhances detection accuracy but also improves detection speed, better meeting the performance requirements for real-time detection of forestry pests.  
On the test set, the visual comparison experiment results between the YOLOv8n model and the model proposed in this study are shown in Figure 8. From (a), it can be observed that when directly using the YOLOv8n model for detection, issues such as missed detection, false positives, and misclassification exist. In contrast, from (b), it can be seen that the model proposed in this study accurately detects each pest in the image, including occluded pest images, effectively addressing the aforementioned issues. Therefore, the detection capability of the model proposed in this study is superior.  
In order to visually demonstrate the performance of our method in predicting target categories, we generated a visual representation of the confusion matrix, as shown in Figure 9. The rows and columns of the confusion matrix correspond to the true and predicted categories, respectively. The values in the diagonal region represent the proportion of correctly predicted categories, while values in other regions indicate the proportion of incorrectly predicted categories. From Figure 10, it can be observed that in our algorithm, the color in the diagonal region of the confusion matrix is darker compared to YOLOv8n, indicating a significant enhancement in our model's ability to accurately predict object categories. However, for some small target pests such as armandi, coleoptera, acuminatus, there still exists a possibility of being misclassified as the background. Through improvements to the model, we have successfully reduced both the false-negative and false-positive rates for these categories, further enhancing the overall performance of the model.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multicolumn{8}{c}{**AP/\%**} & \multirow{2}{*}{**mAP/\%**} & \multirow{2}{*}{**FPS**} \\ \cline{2-2} \cline{5-10}  & **Boerner** & & & & & & & & \\ \hline YOLOv8n & 99.0 & 98.9 & 97.3 & 97.8 & 97.7 & 97.8 & 97.1 & 97.9 & 81 \\ Ours & 98.2 & 99.3 & 99.2 & 98.7 & 98.7 & 98.4 & 99.5 & 98.9 & 93 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Experimental data comparison between the proposed model and the original YOLOv8 model in this paper.  
Figure 8: Visual comparison of the original YOLOv8 Model and the model proposed in this paper. (**a**) YOLOv8n; (**b**) our model.  
Figure 9: (**a**) Confusion matrix plot of YOLOv8n; (**b**) confusion matrix plot of our model.