## 4 Results and Discussion
### Object Detection Experiment  
The evaluation metrics of SFA-ViT in the object detection task are given in Table 5. It should be noted that D-ViT refers to a model that directly employs the target localization network described in Section 2.4 on the basis of the ViT model to achieve object localization. The attention map of the SFA-ViT model is extracted based on the attention mechanism in the classification model, and the classification network is trained on the IP102 classification dataset. The integration of data augmentation enhances the classification network, thereby improving the attention maps extracted by the detection model. The experimental results indicate that the combination of the ViT model and the target localization network already possesses a certain level of object detection capability, albeit with limited performance. The SFA-ViT without augmentation has seen significant improvements in all three evaluation metrics, which demonstrates that extracting feature information from a multi-scale perspective has a significant impact on the model's atten \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Model** & **Accuracy (\%)** & **F1 (\%)** \\ \hline \multirow{6}{*}{IP102} & ExquisiteNet [33] & 52.32 & N/A \\  & DMF-ResNet [34] & 59.22 & 58.37 \\  & SaliencyEnsemble [35] & 61.93 & N/A \\  & GAEnsemble [36] & 67.13 & 65.76 \\  & SGDL-Net [37] & 71.16 & 63.89 \\  & IRNV2 [38] & 71.84 & 64.06 \\ \cline{2-4}  & **SFA-ViT (ours)** & **74.70** & **68.27** \\ \hline \multirow{6}{*}{Plant Village} & [PERSON] et al. [39] & 95.17 & 95.11 \\  & PI-CNN [40] & 97.26 & 92.38 \\ \cline{1-1}  & TL-Ensemble [41] & 98.87 & N/A \\ \cline{1-1}  & DL-GoogleNet [42] & 99.35 & 99.34 \\ \cline{1-1}  & Improved-AlexNet [43] & 99.73 & N/A \\ \cline{1-1}  & EfficientNetB0-MobileNetV2 [44] & 99.77 & N/A \\ \cline{1-1} \cline{2-4}  & **SFA-ViT (ours)** & **99.87** & **99.79** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison results of different models in classification task. Figure 6: The variation in accuracy of SFA-ViT with training epoch in classification task under (**a**) original IP102, (**b**) augmented IP102, (**c**) original Plant Village, (**d**) augmented Plant Village. (‘val_acc’ is the accuracy of SFA-ViT. ‘val_224-acc’, ‘val_160-acc’, and ‘val_128-acc’ represents the accuracy of results under three scales as shown in Figure 3 in SFA-ViT.). tion, enabling the model to focus on more appropriate regions. After introducing the data augmentation model, the SFA-ViT achieved the optimal effect, suggesting that the combination of the three models has further promoted each other, significantly enhancing the performance of object detection, especially the improvement in precise target localization. To further validate the effectiveness of SFA-ViT, the test images and results as well as the attention map in the model were visualized in this study, as shown in Figure 7. It can be observed from the figure that the attention maps at three different scales exhibit varying focus areas. The attention map shows attention to more details as well as key features when the scale is large; the attention position of the model is more accurate for better localization at small scales. Moreover, the fused attention map integrates the advantages at various scales, possessing a more accurate location and also covering detailed situations. Ultimately, this model can effectively capture the target locations within the detection images. Table 6 compares the performance of the proposed model with various object detection models on agricultural pest detection tasks. The comparison results indicate that the SFA-ViT model outperforms all other models across all evaluation metrics, achieving mAP\({}_{0.5-0.95}\) of 34.7%, reaching 56.8% in mAP\({}_{0.5}\), and leading with 37.6% in mAP\({}_{0.75}\). This highlights the significant advantages of the detection model's multi-scale feature extraction and fusion mechanism, allowing for precise localization of pests and diseases within complex agricultural settings.