## 4 Results and Analysis
### Improvement of YOLOv8 Ablation Experiment  
Ablation experiments are a scientific experimental methodology designed to assess the contribution of specific components of a system to the overall functioning of the system by gradually removing or altering those components. Through the ablation experiment, we can understand the working mechanism of the model more deeply, find the advantages and disadvantages of the model, and provide guidance for the further optimization of the model. To evaluate the effectiveness of the improved model, this study conducted five sets of ablation experiments on the same dataset and equipment. These five experiments include the original YOLOv8s model, the addition of the Swin transformer module to YOLOv8s, the replacement of the original convolution with the DSConv module in YOLOv8s, the use of the Focal-EIOU loss function in YOLOv8s, and our proposed method of synthesizing the three modules. The results of the ablation experiments are shown in Table 4. The bold numbers in the table represent the optimal value. Method 1 in Table 4 uses the Focal-EIOU loss function alone to replace the CIOU loss function used in the original model YOLOv8s. Method 2 refers to the introduction of the Swin Transformer module separately in YOLOv8s. Method 3 refers to replacing the convolution DSConv module separately in the original model. In the case of using \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline
**Method** & **+EIOU** & **+Swin Transformer** & **+DSConv** & **Recall** & **mAP50** & **mAP50-95** & **Inference Time (ms)** & **Params (M)** \\ \hline YOLOv8s & & & & 0.752 & 0.846 & 0.713 & **4.0** & 11.13 \\ Method 1 & ✓ & & & 0.759 & 0.851 & 0.721 & 4.1 & 11.13 \\ Method 2 & & ✓ & & 0.783 & 0.863 & **0.732** & 4.4 & 11.00 \\ Method 3 & & & ✓ & 0.786 & 0.866 & 0.728 & 4.1 & 10.31 \\ Proposed Method & ✓ & ✓ & ✓ & **0.820** & **0.869** & 0.727 & 4.4 & **10.18** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of Ablation experiment. Bold values indicate the optimal values in the results. A checkmark indicates that the module is used. Figure 7: Training and validation process curves for the proposed model. The horizontal coordinate is the training Epoch. YOLOv8s for maturity detection without any improvement. The Recall rate of the model, mAP50, mAP50-95, inference time, and the number of parameters are 75.2%, 84.6%, 71.3%, 4.0 ms, and 11.13 M, respectively. In Method 1, after using Focal-EIOU to replace CIOU, the Recall of the model, mAP50, and mAP50-90 increased by 0.7%, 0.5%, and 0.8%, respectively. This is because the Focal-EIOU loss function can effectively reduce the influence of the background and make the model pay more attention to the target detection, thus improving the detection accuracy of the model. For the inference time, the inference time of Method 1 is only 0.1 ms more than that of the original model YOLOv8s. It does not have much impact on the overall performance of the model and can be ignored. In terms of the number of parameters, the number of parameters of Method 1 does not change because the loss function does not change the structure of the model. In general, it is effective to use Focal-EIOU to improve the model. Method 2, a model in which Swin Transformer alone was introduced into the original YOLOv8, improved Recall, mAP50, and mAP50-95 by 3.1%, 1.7%, and 1.9%, respectively, compared with the original YOLOv8 model. The main reason for the accuracy improvement may be that the Swin Transformer is able to capture the subtle features of tomato fruit at different ripening stages more effectively, improving the model's detection accuracy in complex environments. At the same time, the parameter volume of the model was reduced by 0.13 M, which is due to the fact that Swin Transformer optimizes the number of parameters of the model by reducing redundant calculations and adopting the local window mechanism, which reduces the computational complexity, resulting in a reduction in the number of parameters while improving the accuracy.