## 3 Results and Discussion
### Discussion  
In the analysis of the results, it was clearly shown that RS Transformer performed well. Since Swin Transformer was proposed, which performed better than the CNN did, a large number of application algorithms based on Swin Transformer have been proposed [37; 38; 39]. However, a common feature among these algorithms is that a large number of datasets are required to train Swin Transformer to realize its ability to extract features globally. Therefore, we added an FPN, RPN, and ROI Align on the basis of Swin Transformer, which reduces the computational complexity and improves the feature extraction capability. Then, using the RGSDD method to generate a dataset to assist with training, we not only achieved the purpose of expanding the dataset, but also improved the training accuracy of the model. The RS Transformer achieved 9.08% accuracy, which was higher than that of the DETR universal model at 1.41% and higher than that of the YOLOv8 model at 6.59%. Its superior multi-scale feature extraction capabilities effectively help improve accuracy.  
In a two-stage model like that of [PERSON] [40], the author used ResNet-50 as a backbone. Even though the model was improved and deep convolutional neural networks (DCNNs) were used, it still failed to achieve ideal results at a small scale, with an mAP value of only 67.9%. [PERSON] [22] used VGG-16 as a backbone and trained with a large number of datasets comprising about 25.4k images. However, [PERSON] only obtained an mAP of 56.40%. In a large number of training datasets, the algorithms proposed by the authors still fail to reach the required application. On the one hand, the pest scale is small; on the other hand, the feature extraction ability of the CNN is limited. In deep learning, we explain which backbone or which model has absolute advantages in an application field, but in our experiment, we found that RS Transformer does have certain advantages.  
Before this study, there was no research on agricultural pest identification based on AIGC. For the first time, we used a diffusion model for agricultural pest training and image generation and achieved unexpectedly good results. After adding 30% of the generated images, RS Transformer; YOLOv3, 4, 5, and 8; and DETR were all improved, up to 8.93%. This kind of high-resolution generated image is less noisy, is more conducive to model training, and helps to quickly locate and extract effective features.  
In general, the quality and size of the dataset, the appropriate improvement strategy, and the underlying model architecture all have important effects on the detection accuracy. A multi-stage algorithm is faster and has a lighter weight on the basis of ensuring accuracy, while a single-stage algorithm improves the detection accuracy on the basis of maintaining the advantages of speed and model size. Achieving higher performance levels and achieving a balance of performance such as accuracy, speed, and magnitude are the current trends.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Method** & **Dataset** & **RGSDD** & **mAP** \\ \hline [PERSON] et al. [35] & CNN, MobileNetV2 & \(\times\) & 82.95 \\ [PERSON] et al. [36] & ViT & \(\times\) & 85.17 \\ Our proposal & Swin Transformer & \(\times\) & 90.18 \\ [PERSON] et al. [35] & CNN, MobileNetV2 & 30\% & 89.35 \\ [PERSON] et al. [36] & ViT & 30\% & 88.23 \\ Our proposal & Swin Transformer & 30\% & 95.71 \\ \hline \hline \end{tabular}
\end{table}
Table 12: Related work and accuracy results (%) summary.