## 3 Results and Discussion  
### Experimental Results and Analysis  
On a dataset with eight models, we assessed the performance of popular deep learning models to illustrate the performance of the proposed model (Table 5). We used a fixed image resolution with a size of 299 \(\times\) 299 pixels. Compared to other models, our proposed method achieved significant improvements, with an mAP of 90.18%, representing gains of 13.27%, 17.53%, 29.8%, 13.97%, 9.89%, 5.46%, and 4.62% over SSD, Faster R-CNN, YOLOv3, YOLOv4, YOLOv5m, YOLOv8, and DETR, respectively. The proposed method achieved 20.1 ms mDT for the detection time of each image. To visually analyze the classification results of each pest in RS Transformer, we utilized a confusion matrix as shown in Figure 11. These data were obtained using real images for training. The confusion matrix provides an intuitive representation of the classification performance. In the matrix, rows represent predicted pest categories, columns represent actual pest categories, and the values on the main diagonal represent the classification accuracy for each category. From the confusion matrix diagram, it can be observed that the color on the main diagonal of the RS Transformer's confusion matrix is the darkest, indicating the highest values in each row and column. This indicates that RS Transformer exhibits excellent classification performance for each type of pest. Figure 11: Confusion matrix for RS Transformer. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **mAP (\%)** & **F1 Score (\%)** & **Recall (\%)** & **Precision (\%)** & **Accuracy (\%)** & **mDT (ms)** \\ \hline SSD & 76.91 & 67.62 & 70.12 & 66.23 & 77.11 & 22.9 \\ Faster R-CNN & 72.65 & 65.57 & 69.31 & 67.10 & 73.52 & 24.5 \\ YOLOv3 & 60.38 & 52.38 & 57.78 & 53.64 & 60.32 & 17.7 \\ YOLOv4 & 76.31 & 69.55 & 74.97 & 68.91 & 76.99 & 10.7 \\ YOLOv5m & 80.29 & 75.58 & 79.14 & 77.33 & 79.35 & 13.6 \\ YOLOv8 & 84.72 & 80.32 & 82.11 & 79.59 & 83.49 & 9.8 \\ DETR & 85.56 & 81.18 & 82.82 & 80.43 & 86.12 & 19.2 \\ RS Transformer & 90.18 & 85.89 & 87.31 & 89.91 & 90.08 & 20.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of different indexes. The contrast in mAP is visually presented in Figure 12. It is evident that the mAP of the three compared models exhibits an upward trend during the training process, albeit with substantial fluctuations. Conversely, our model's mAP shows a more consistent trajectory, stabilizing at 77.73% after approximately 75 epochs. Subsequently, the RS Transformer model attains its peak performance, achieving a maximum mAP of 90.18%. These findings collectively confirm the stability of RS Transformer, its capacity to enhance network performance, and its ability to expedite convergence. RS Transformer exhibits a robust capacity for discerning similar pests and demonstrates superior overall performance compared to other models, as detailed in Table 6 (models' mAP) and illustrated in Figure 13. Furthermore, in challenging scenarios such as the TU dataset, the model maintains a remarkable recognition rate of 90.24%. Figure 12: Comparisons of mAP. Figure 13: Comparison of mAPs to identify similar pests. The dataset was generated using the diffusion model (see Figure 14) and subsequently combined at varying proportions of 10%, 20%, 30%, 40%, and 50%. These datasets were then utilized as inputs for the RS Transformer model, followed by rigorous testing procedures, culminating in the presentation of the results in Table 7.  
Applying the RGSDD method to RS Transformer, it is evident that upon incorporating 30% of the generated data, the model attains its peak performance, resulting in a notable increase of 5.53% in mAP. The RGSDD methodology was also applied to enhance the performance of the Faster R-CNN, YOLOv5m, YOLOv8, and DETR models. The results of these experiments demonstrate that RGSDD positively contributes to model enhancement, as evidenced in Tables 8-11.