###### Abstract  
The existing strawberry ripeness detection algorithm has the problems of a low precision and a high missing rate in real complex scenes. Therefore, we propose a novel model based on a hybrid attention mechanism. Firstly, a partial convolution-based compact inverted block is developed, which significantly enhances the feature extraction capability of the model. Secondly, an efficient partial hybrid attention mechanism is established, which realizes the remote dependence and accurate localization of strawberry fruit. Meanwhile, a multi-scale progressive feature pyramid network is constructed, and the fine-grained features of strawberry targets of different sizes are accurately extracted. Finally, a Focaler-shape-IoU loss function is proposed to effectively solve the problem of the difficulty imbalance between strawberry samples and the influence of the shape and size of the bounding box on the regression. The experimental results show that the model's precision and mAP0.5 reach 92.1% and 92.7%, respectively, which are 2.0% and 1.7% higher than the baseline model. Additionally, our model is better in detection performance than most models with fewer parameters and lower FLOPs. In summary, the model can accurately identify the maturity of strawberry fruit under complex farmland environments and provide certain technical guidance for automated strawberry-picking robots. s +
Footnote †: journal: applied sciences  
superior feature extraction and self-learning capabilities [7]. Moreover, the integration of traditional agricultural practices with deep learning innovations has emerged as a major trend, driving the rapid advancement of agricultural information and automation [8]. Deep-learning-based methods have also demonstrated an excellent performance in strawberry detection. [PERSON] et al. [9] developed a Mask R-CNN-based model for classifying strawberry ripeness in complex field environments. However, the high complexity and low computational efficiency of the model limit its widespread application. [PERSON] et al. [10] proposed a lightweight YOLO-based algorithm that accurately identifies strawberry ripeness in complex backgrounds. Experimental results indicate that the model size is only 7.44 MB and the mAP0.5 is 0.956, demonstrating its potential for deployment in strawberry-harvesting robots. Conversely, [PERSON] et al. [11] introduced the BCo-YOLOv5 model, which was successfully applied to fruit target detection in orchards, with a significantly lower level of computational complexity compared to Fast R-CNN, making it suitable for real-time object detection scenarios. Furthermore, [PERSON] et al. [12] proposed the DSE-YOLO network, which can accurately detect strawberries at various stages of ripeness in natural scenes. Recently, [PERSON] et al. [13] launched the LS-YOLOv8s model, which integrates Swin Transformer and multi-head self-attention mechanisms, significantly improving the accuracy of strawberry ripeness detection. Building on this, [PERSON] et al. [14] proposed a YOLOv8-based model for identifying ripe and unripe strawberries. By analyzing the hue, saturation, and value (HSV) channels, the model counts the red pixels along the central line of ripe strawberries, enabling the rapid and accurate identification of strawberries at different ripeness stages in controlled environments. Additionally, [PERSON] et al. [15] enhanced the YOLOv8 model by replacing some of the C2f modules in the backbone with ConvNeXtV2 modules, which improved the model's ability to capture features across different maturity levels of strawberries. Although these algorithms have been demonstrated to be deployable for strawberry ripeness detection tasks, there are significant challenges in applying these models in most real-world complex environments. To address this issue, a novel detection model based on YOLOv8n has been developed. Initially, the backbone of the original model was redesigned to extract features from strawberry targets.