# A New Hybrid ConvViT Model for Dangerous Farm Insect Detection
## 4 The Experimental Results  
This study created a hybrid ConvViT model to detect dangerous agricultural pests. The created ConvViT model was extensively compared with EfficientNetB0, DenseNet201, ResNet-50, VGG-16, and a ViT. The rest of this section presents each model's confusion matrices and experimental results. Experimental results for the ViT are shown in Figure 5 and Table 3.  
Figure 5 shows the confusion matrix for the ViT. As seen in Figure 5, the ViT correctly classified 326 out of 360 images and incorrectly classified 34. The ViT had 90.55% accuracy. The misclassification pattern suggests that the ViT had difficulty distinguishing between aphids (Class 2), armyworms (Class 3), and brown marmorated stink bugs (Class 4), potentially due to their similar morphological characteristics. Figure 5: The confusion matrix for the ViT. As seen in Table 3, the ViT had 0.9116 precision, 0.9055 recall, and a 0.9067 F-score. Compared to other classes, the ViT had an F-score below 0.9 for classes 2, 3, 4, 7, and 10. The experimental results of the ViT show that the model had a successful classification performance in general. Experimental results for DenseNet201 are shown in Figure 6 and Table 4.  
Figure 6 illustrates the confusion matrix for DenseNet201, which correctly classified 316 out of 360 images, with an accuracy of 87.77%. The model shows a tendency to \begin{table}
\begin{tabular}{c c c c} \hline
**Class** & **Accuracy** & **Precision** & **Recall** & **F-Score** \\ \hline Africanized honey bees (Class 1) & 1.0000 & 0.8333 & 0.9090 \\ \hline Aphids (Class 2) & 0.7916 & 0.7916 & 0.7916 \\ \hline Armyworms (Class 3) & 0.7931 & 0.9583 & 0.8679 \\ \hline Brown marmorated stink bugs (Class 4) & 0.8076 & 0.8750 & 0.8400 \\ \hline Cabbage loopers (Class 5) & 0.9565 & 0.9166 & 0.9361 \\ \hline Citrus canker (Class 6) & 0.9166 & 0.9166 & 0.9166 \\ \hline Colorado potato beetles (Class 7) & 0.8076 & 0.8750 & 0.8400 \\ \hline Corn borers (Class 8) & 0.8846 & 0.9583 & 0.9200 \\ \hline Corn earworms (Class 9) & 0.9166 & 0.9166 & 0.9166 \\ \hline Fall armyworms (Class 10) & 0.8800 & 0.9166 & 0.8979 \\ \hline Fruit flies (Class 11) & 0.9200 & 0.9583 & 0.9387 \\ \hline Spider mites (Class 12) & 1.0000 & 0.9166 & 0.9565 \\ \hline Thrips (Class 13) & 1.0000 & 0.9166 & 0.9565 \\ \hline Tomato hornworms (Class 14) & 1.0000 & 0.9166 & 0.9565 \\ \hline Western corn rootworms (Class 15) & 1.0000 & 0.9166 & 0.9565 \\ \hline Weighted average & 0.9055 & 0.9116 & 0.9055 & 0.9067 \\ \hline \end{tabular}
\end{table} 
Table 3: Classification report for the ViT. Figure 6: The confusion matrix for DenseNet201. miscalify aphids (Class 2) and Colorado potato beetles (Class 7), which aligns with the lower F-scores observed in the classification report. As seen in Table 4, DenseNet201 had 0.8883 precision, 0.8777 recall, and a 0.8798 F-score. Compared to other classes, DenseNet201 had F-scores above 0.9 for classes 5, 10, 11, 12, 13, 14, and 15. The experimental results of DenseNet201 show that the model had a successful classification performance overall, although it was lower than that of the  
Figure 7 shows the confusion matrix for ResNet-50. As seen in Figure 7, ResNet-50 correctly classified 304 out of 360 images and incorrectly classified 56 images, with an accuracy of 84.44%. As seen in Table 5, ResNet-50 had 0.8520 precision, 0.8444 recall, and a 0.8443 F-score. Compared to other classes, ResNet-50 had F-scores above 0.9 for classes 6, 7, 11, 12, and 14. The experimental results of ResNet-50 show that the model had a successful classification performance overall, although it was lower than that of the ViT and DenseNet201. Experimental results for VGG-16 are shown in Figure 8 and Table 6.  
Figure 8 shows the confusion matrix for VGG-16. As seen in Figure 8, VGG-16 correctly classified 277 out of 360 images and incorrectly classified 83 images. VGG-16 had 76.94% accuracy. This model suffered from frequent misclassification, especially in Africanized honey bees (Class 1) and fall armyworms (Class 10).