Real-Time Detection Algorithm for Strawberry Maturity Based on Improved YOLOv5s
In this study,YOLOv5s-SCS,a real-time detection algorithm for strawberry maturity was pro-posed based on YOLOv5s.Aiming at the characteristics of large number,small size,covered,overlapping and density of strawberries during detection process,the algorithm optimized the problems of false detection and missing detection for small and dense targets,and significantly improved the detection speed.Firstly,SimOTA matching algorithm was introduced to dynamically assign positive samples of ripe strawberries to improve the recognition ability of ripe strawberries.Secondly,part of C3 module in YOLOv5s neck was replaced with C2f module,which realized the lightweight of model and improved the average detection accuracy.Finally,the Squeeze-and-Excitation(SE)attention mechanism with global receptor field was added to the first C3 module of the YOLOv5s backbone network.The SE mechanism can obtain the importance of each feature channel through automatic learning,and then use the obtained importance to promote features and suppress features which are not important to the task at hand.The experimental results showed that the mean average precision(mAP),accuracy rate,recall rate,model volume and detection speed of the improved algorithm were 98.3%,92.6%,96.6%,13.5 MB and 89.3 frames per second respectively,which were 1.8,1.3 and 2.1 per-centage points higher in mAP,accuracy rate and recall rate respectively compared with the original YOLOv5s,and also 0.32 MB less in model volume and 82.2%higher in detection speed;the time of NMS(non-maximum suppression processing)and image preprocessing was greatly reduced,and the detection speed could meet the real-time detection requirement.Compared with other algorithms,the algorithm had better recognition accuracy and smaller model volume,and had good robustness in complex environment,which provided a solution for developing real-time detection system of strawberry maturity.
Deep learningStrawberry maturity detectionYOLOv5sSE attention mechanismSimOTA