In this research, an integrated detection model, Swin-transformer-YOLOv5 or Swin-T-YOLOv5, was proposed for real-time wine grape bunch detection to inherit the advantages from both YOLOv5 and Swin-transformer. The research was conducted on two different grape varieties of Chardonnay (always white berry skin) and Merlot (white or white-red mix berry skin when immature; red when matured) from July to September in 2019. To verify the superiority of Swin-T-YOLOv5, its performance was compared against several commonly used/competitive object detectors, including Faster R-CNN, YOLOv3, YOLOv4, and YOLOv5. All models were assessed under different test conditions, including two different weather conditions (sunny and cloudy), two different berry maturity stages (immature and mature), and three different sunlight directions/intensities (morning, noon, and afternoon) for a comprehensive comparison. Additionally, the predicted number of grape bunches by Swin-T-YOLOv5 was further compared with ground truth values, including both in-field manual counting and manual labeling during the annotation process. Results showed that the proposed Swin-T-YOLOv5 outperformed all other studied models for grape bunch detection, with up to 97% of mean Average Precision (mAP) and 0.89 of F1-score when the weather was cloudy. This mAP was approximately 44%, 18%, 14%, and 4% greater than Faster R-CNN, YOLOv3, YOLOv4, and YOLOv5, respectively. Swin-T-YOLOv5 achieved its lowest mAP (90%) and F1-score (0.82) when detecting immature berries, where the mAP was approximately 40%, 5%, 3%, and 1% greater than the same. Furthermore, Swin-T-YOLOv5 performed better on Chardonnay variety with achieved up to 0.91 of R2 and 2.36 root mean square error (RMSE) when comparing the predictions with ground truth. However, it underperformed on Merlot variety with achieved only up to 0.70 of R2 and 3.30 of RMSE.
翻译:本研究提出了一种集成检测模型Swin-transformer-YOLOv5(简称Swin-T-YOLOv5),旨在融合YOLOv5与Swin-transformer的双重优势,实现酿酒葡萄果穗的实时检测。研究于2019年7月至9月针对两个葡萄品种——霞多丽(始终为白皮浆果)和梅洛(未成熟时白皮或白红混合浆果,成熟后为红色浆果)展开。为验证Swin-T-YOLOv5的优越性,将其性能与Faster R-CNN、YOLOv3、YOLOv4及YOLOv5等常用/高竞争力目标检测器进行对比。所有模型在不同测试条件下进行评估,包括两种天气条件(晴天与多云)、两种浆果成熟阶段(未成熟与成熟)及三种日照方向/强度(清晨、正午与下午),以实现全面比较。此外,将Swin-T-YOLOv5预测的葡萄果穗数量与地面真值(含田间人工计数与标注过程的人工标记)进一步对比。结果表明,所提出的Swin-T-YOLOv5在葡萄果穗检测中优于所有其他研究模型:在多云天气下,平均精度均值(mAP)高达97%,F1分数达0.89。该mAP较Faster R-CNN、YOLOv3、YOLOv4及YOLOv5分别提升约44%、18%、14%和4%。在检测未成熟浆果时,Swin-T-YOLOv5达到最低mAP(90%)与F1分数(0.82),但mAP仍较上述模型分别高出约40%、5%、3%和1%。此外,将预测结果与地面真值对比时,Swin-T-YOLOv5对霞多丽品种表现更优,决定系数R²达0.91,均方根误差(RMSE)为2.36;但对梅洛品种表现欠佳,R²仅为0.70,RMSE达3.30。