# A Strawberry Ripeness Detection Method Based on Improved YOLOv8
## 3 Analysis of Experimental Results
### Heatmap Visualization  
In order to further investigate the differences in attention regions among object detection models when recognizing strawberry targets, this study adopted the GradCAM++ method to visualize and compare the performance of FAST-R CNN, YOLOv5, YOLOv7, YOLOv8, and the improved YOLOv8_CDW. The configuration of the visualization settings was as follows: the method was set to GradCAMPlusPlus, the layer to [12], and the backward_type to all, with a confidence threshold of 0.2. In order to maintain consistency, both the bounding box display (show_box = False) and the renormalization (renormalize = False) functions were disabled. The regions that are indicated by a red coloration are indicative of a greater degree of model attention.  
As illustrated in Figure 15, the application of each model to three exemplary strawberry images is represented by heatmaps. As demonstrated, the YOLOv8_CDW model demonstrates the most concentrated activation regions, with clear attention focused on the strawberry objects and minimal background interference, indicating superior speci  
Figure 14: Several different improvement methods in [EMAIL_ADDRESS].  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **Precision** & **Recall** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]:0.95** & **F1 Score** \\ \hline YOLOv8 & 0.873 & 0.789 & 0.863 & 0.649 & 0.860 \\ YOLOv8\_WioU & 0.951 & 0.926 & 0.957 & 0.793 & 0.924 \\ YOLOv8\_CA & 0.951 & 0.926 & 0.958 & 0.793 & 0.938 \\ YOLOv8\_DySample & 0.951 & 0.926 & 0.958 & 0.793 & 0.943 \\ YOLOv8\_CA\_DySample & 0.947 & 0.931 & 0.965 & 0.815 & 0.944 \\ YOLOv8\_CDW & **0.969** & **0.936** & **0.973** & **0.823** & **0.972** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of improvement results based on YOLOv8 model.  
ficity and robustness. The standard YOLOv8 model demonstrates a marginal decrease in performance, exhibiting generally accurate focus but occasional instances of edge diffusion. YOLOv6 demonstrates a greater degree of concentrated attention in comparison to YOLOv5, indicating an enhancement in architectural design. It has been demonstrated that FAST-RCNN, during the generation of multiple hotspots, incorporates irrelevant background regions. This finding suggests a higher degree of reliance on non-target regions during the process of decision-making.  
Figure 15: Detection result comparison diagram of FAST R-CNN, YOLOv5, YOLOv7, YOLOv8, and YOLOv8_CDW. Red: Areas with the highest model attention, indicating the highest confidence that the target (strawberry) is present. Orange: Areas with high model attention and relatively high confidence. Yellow: Areas with moderate model attention, possibly containing partial target features. Green: Areas with low model attention and low confidence. Blue: Areas with minimal model attention, indicating very low confidence that the target is present.  
In conclusion, it is evident that under identical GradCAM++ configurations, the YOLOv8_CDW model consistently yields the most interpretable and reliable attention distribution, thereby rendering it particularly well suited for high-precision detection in complex environments.