# A Strawberry Ripeness Detection Method Based on Improved YOLOv8
## 3 Analysis of Experimental Results  
### Comparative Experiment  
To verify the superiority of the baseline model, experiments were conducted on FAST R-CNN, YOLOv5, YOLOv7, and YOLOv8 using the self-collected strawberry dataset. These models were compared under similar parameter counts and computational complexity. The detailed comparison results are presented in Table 2. During training, not all models utilized pre-trained weights. The testing environment and experimental configuration were consistent across all experiments. As shown in Table 2, the YOLOv8 model achieved the best balance between detection accuracy and efficiency. Therefore, selecting YOLOv8 as the baseline model is justified. Figure 9 illustrates the training results for different algorithms, indicating that YOLOv8_CDW outperforms the other methods. As demonstrated in Figure 10, the normalized confusion matrices of the original YOLOv8 model and the improved YOLOv8 model are presented, thus facilitating a clear comparative analysis of their detection performance across four object categories. The words \"raw\", \"turning\", \"ripe\", and \"background\" are employed. The horizontal axis denotes the ground-truth labels, while the vertical axis represents the predicted classes. The figure illustrates the mean classification accuracy for each cell. The darker the color, the higher the prediction precision. For the original YOLOv8 model, the detection accuracies for \"raw\", \"turning\", and \"ripe\" were approximately 68%, 91%, and 85%, respectively. However, a significant misclassification was observed between the \"raw\" and \"background\" classes, with 66% of \"raw\" instances being incorrectly predicted as background. In a similar vein, the \"turning\" class was subject to a degree of confusion, with approximately 21% of cases being misclassified as background. Errors were also exhibited by the background class, with 32% of \"raw\" and 10% of \"ripe\" instances being misidentified. \begin{table}
\begin{tabular}{c c c c c c} \hline
**Model** & **Precision** & **Recall** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]:0.95** & **F1 Score** \\ \hline FAST R-CNN & 0.713 & 0.611 & 0.837 & 0.630 & 0.660 \\ YOLOv5 & 0.889 & 0.793 & 0.885 & 0.559 & 0.856 \\ YOLOv7 & 0.892 & 0.808 & 0.897 & 0.763 & 0.847 \\ YOLOv8 & 0.894 & 0.789 & 0.862 & 0.649 & 0.860 \\ YOLOv8\_CDW & **0.969** & **0.936** & **0.973** & **0.823** & **0.972** \\ \hline \end{tabular}
\end{table} 
Table 2: Comparison of results of different YOLO baseline models. Figure 9: Comparison of [EMAIL_ADDRESS] of different algorithms. In contrast, the enhanced YOLOv8 model demonstrated superior recognition accuracy and enhanced class separation. For instance, the detection accuracy for the \"ripe\" class increased to 84%, while misclassification between \"turning\" and \"background\" was noticeably reduced. This enhancement indicates that the proposed improvements have been effective in reducing the confusion between similar classes and backgrounds. Consequently, this has led to an enhancement in the robustness and precision of the overall detection process. The performance comparison between the original YOLOv8 model and the enhanced YOLOv8-CDW model is comprehensively illustrated in Figure 11 across four key evaluation metrics: recall (Figure 10(a)), precision (Figure 10(b)), [EMAIL_ADDRESS] (Figure 10(c)), and [EMAIL_ADDRESS]:0.95 (Figure 10(d)). Figure 11: The four evaluation metrics before and after improvement: (**a**) Recall, (**b**) Precision, (**c**) [EMAIL_ADDRESS], and (**d**) [EMAIL_ADDRESS]:0.95: (**a**) original YOLOv8 model; (**b**) YOLOv8-CDW. As shown in Figure 12a, the YOLOv8-CDW model consistently achieves higher recall values than the original YOLOv8 throughout the training process. This superiority is especially pronounced in later epochs where the recall stabilizes at a higher level, indicating improved capability in detecting true positive instances and reducing missed detections.