An improved YOLOv5s model using feature concatenation with attention mechanism for real-time fruit detection and counting - Lawal, Olarewaju Mubashiru; Zhu, Shengyan; Cheng, Kui (Frontiers in Plant Science, 2023)
An improved YOLOv5s model was proposed and validated on a new fruit dataset to solve the real-time detection task in complex environment. With the incorporation of feature concatenation and an attention mechanism into the original YOLOv5s network, the improved YOLOv5s recorded 122 layers, 4.4×106 params, 12.8 GFLOPs and 8.8 MB weight-size, which is 45.5%, 30.2%, 14.1% and 31.3% respectively smaller than the original YOLOv5s. Meanwhile, the obtained 93.4% of mAP tested on valid-set, 96.0% of mAP tested on test-set and 74 fps of speed tested on videos using improved YOLOv5s is 0.6%, 0.5% and 10.4% higher than the original YOLOv5s model, respectively. Using videos, the fruits tracking and counting tested on improved YOLOv5s observed less missed and incorrect detections compared to original YOLOv5s. Furthermore, the aggregated detection performance of improved YOLOv5s outperformed the network of GhostYOLOv5s, YOLOv4-tiny and YOLOv7-tiny, including other mainstream YOLO variants. Therefore, the improved YOLOv5s is lightweight with reduced computation costs, can better generalize against complex conditions and is applicable for real-time detection in fruit picking robots and low-power devices.