# A Strawberry Ripeness Detection Method Based on Improved YOLOv8
## 4 Discussion  
With the continued growth of the global population and mounting pressure on arable land resources, enhancing agricultural productivity has become an urgent priority. Automated harvesting robot technology, a pivotal advancement in intelligent agriculture, significantly improves harvesting efficiency while reducing labor costs [33]. However, traditional methods for fruit ripeness detection primarily rely on simple features such as color and size, which are insufficient under variable environmental conditions and large color differences. Although several methods have been proposed, they often remain highly dependent on external environments and struggle to balance detection accuracy and computational efficiency [27]. Thus, developing a robust and efficient algorithm for strawberry ripeness detection is of critical importance.  
To address these challenges, this study proposes an improved YOLOv8-based model, named YOLOv8_CDW which enhances detection accuracy and robustness without compromising real-time performance. In the data collection phase, variations in lighting, occlusion, and viewing angles were fully considered, thereby improving the model's adaptability to real-world agricultural conditions. Furthermore, key structural modifications were made: the conventional bilinear interpolation upsampling module was replaced with the DySample module, and a CA mechanism was integrated into the C2F layer.  
Despite the fact that the overall quantitative metrics of all of the models under comparison demonstrate analogous trends, the integration of CA and DySample modules results in substantial enhancements in classification precision and background suppression. The present findings are consistent with earlier studies suggesting that attention mechanisms have the capacity to augment feature representation by accentuating salient channels and mitigating inter-class confusion. CA recalibrates feature responses for each channel in order to facilitate the network's ability to focus on discriminative information that is relevant to the target categories. DySample is a dynamic sampling strategy that adjusts the sample selection based on the data distribution. This helps the model learn from difficult examples and improves its generalization ability.  
The experimental results demonstrate that the proposed YOLOv8_CDW model achieves significant improvements in strawberry ripeness detection, with 96.9% precision, 93.6% recall, 97.3% [EMAIL_ADDRESS], and an F1 score of 95.5%. Compared to the baseline YOLOv8, this corresponds to gains of 8.39%, 18.63%, and 12.75% ([EMAIL_ADDRESS]), respectively. These advancements contribute to minimizing misclassification of ripeness stages, thereby optimizing harvest timing and enhancing consistency in field application, even under variable environmental conditions.  
Nonetheless, this study has several limitations. While the model performs well in strawberry detection, its generalizability to other fruits or crops remains to be tested. The complex interplay between climate, soil, and crop physiology also poses a challenge to model stability. Moreover, although variations in lighting and occlusion were considered, this study did not fully examine physiological traits. Future research should quantify these factors' impacts and further optimize the architecture.  
To overcome these limitations, future work should explore the model's generalization across different fruit types and developmental stages. Special attention should also be given to its adaptability and stability under diverse real-field scenarios, including variable climate conditions and pest interference. Continuous optimization will further contribute to the development of smart agriculture and autonomous harvesting systems, supporting sustainable agricultural productivity.