###### Abstract
It led to a 2.4% increase in model parameter counts but improved its performance in detecting complex strawberries that are overlapping, occluded, or exhibit colors similar to the background. Considering the limited receptive field of CNNs, which hampers the capture of global features, it was noted that Transformers [16] possess the ability to simulate global contextual information, a feature that CNNs lack. Therefore, the combination of multi-head self-attention (MHSA) from Transformers and CNNs was considered to fully leverage the strengths of both. A lightweight multi-head self-attention (LMSA) was invented to reduce its computational cost. LMSA was again coupled with an efficient local attention (ELA) [17] mechanism to create an efficient partial hybrid attention mechanism (PHAM). This mechanism was introduced solely at the lowest resolution at the bottom of the backbone network to avoid the excessive computational burden associated with self-attention. This design not only integrated global learning capabilities into the model but also improved its ability to locate regions of strawberries at different ripeness levels. Additionally, to address the insufficient feature fusion capabilities of the original neck network, a multi-scale progressive feature pyramid (MS-FPN) was constructed, integrated with PHAM by incorporating adaptively spatial feature fusion (ASFF) [18] technology and an efficient DySample upsampler [19]. This approach effectively reduced the loss of key information during the upsampling process and enhanced its feature fusion capabilities, thereby improving the model's performance in detecting fine-grained features of strawberries of various sizes and at different ripeness levels. Finally, taking the predominantly heart-shaped or slightly flattened round shapes of strawberries into account, the Focaler-shape-IoU method was leveraged to emphasize the impact of boundary box shapes and scales, improving the recognition accuracy of challenging samples in complex scenes. The main contributions of this study are summarized as follows:1. A compact inverted module (PCIB) based on a partial convolution (Pconv) module was designed to replace the bottleneck structure of the C2f module in the backbone network, significantly capturing the key features of strawberries at different ripeness levels;
2. The ELA mechanism was combined with the LMSA mechanism to create the PHAM attention mechanism, which enhances the ability of the model to perceive long-range information and capture the location of strawberry target areas with reduced computational costs;
3. The MS-FPN integrated with the PHAM was constructed by merging the AFF unit and an efficient DySample upsampler. Advanced features with multidimensional spatial information and position sensitivity processed by the PHAM were gradually incorporated into the feature fusion process, effectively improving its information transmission ability between network channels;
4. The issue of imbalance in difficulty among strawberry samples was effectively addressed by integrating the Focaler-IoU and Shape-IoU loss functions, significantly improving the accuracy of the boundary box regression for strawberries at different ripeness levels. The remainder of the article is organized as follows. Section 2 introduces the specific algorithm, while Section 3 presents and discusses the experimental results. Section 4 summarizes the main conclusions, analyzes existing limitations, and offers prospects for future research directions.