## 4 Results and Discussion
### Model Performance  
To maintain consistency with the resolution of training images, the trained models RT-DETR, RT-DETR-Tomato-S, RT-DETR-Tomato-B, and RT-DETR-Tomato-BS were tested and compared using images with a resolution of 640 \(\times\) 640 pixels. Natural scenes are more reliable because they occur every day. The experimental results of natural scene contrast areshown in Table 1. The best weights of the models are provided for analysis. The training time for the RT-DETR model is 2.057 h, for the RT-DETR-Tomato-S model is 2.633 h, for the RT-DETR-Tomato-B model is 1.091 h, and for the RT-DETR-Tomato-BS model is 1.305 h. We trained each model for 200 epochs, recording and analyzing the training logs. All algorithms began to converge around 70 epochs, with the RT-DETR-Tomato-BS model converging slightly later, starting at 90 epochs. When the models began to converge, the loss reduction tended to stabilize, and the train and validation loss values decreased in the same trend, without any signs of overfitting. Meanwhile, various performance metrics, such as mAP, increased slowly and steadily, indicating normal model training. Considering both training costs and model performance, we determined that 120 epochs were suitable for achieving an optimal model. The training process is illustrated in Figure 9. All models detected the number of tomatoes in the test dataset, including images affected by lighting and occlusion, and achieved good detection results. However, there are differences in the results obtained from different test models.  
Based on the results of natural scenes in Table 1, the RT-DETR-Tomato detection model significantly improves recall and precision, increasing the F1 score. Compared to the RT-DETR base model, the F1 score of RT-DETR-Tomato-B increased from 81.2% to 84.1%. The improvement is attributed to the self-attention mechanism within the Swin Transformer window and the cross-window connections, which support multi-scale feature extraction. mAP50 is considered more accurate than the F1 score as it displays the global precision-recall relationship. Therefore, the mAP50 values of RT-DETR-Tomato-BS are approximately 3.3%, 0.7%, and 1.3% higher than those of RT-DETR, RT-DETR-Tomato-S, and RT-DETR-Tomato-B, respectively, indicating the need for further research. In this case, the average AP results obtained from Table 1 can be used for comparison. It can be concluded that \"RT-DETR-Tomato-BS \(>\) RT-DETR-Tomato-S \(>\) RT-DETR-Tomato-B \(>\) RT-DETR\". Furthermore, all models tested on the natural scene dataset have an IoU of more than 50%, which is considered a good prediction.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Models** & **IoU (\%)** & **P (\%)** & **R (\%)** & **F1 (\%)** & **mAP50 (\%)** & **mAP50-95 (\%)** \\ \hline RT-DETR & 78.3 & 82.5 & 80.0 & 81.2 & 85.4 & 44.8 \\ RT-DETR-Tomato-S & 78.8 & 84.4 & 82.3 & 83.3 & 88.0 & 49.0 \\ RT-DETR-Tomato-B & 79.0 & 84.1 & 82.7 & 83.2 & 87.4 & 48.3 \\ RT-DETR-Tomato-BS & 78.8 & 85.3 & 82.9 & 84.1 & 88.7 & 50.3 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Average test results of models created from the natural scene dataset.  
Figure 9: Training performance at each stage of the model.