摘要
针对目前统计西红柿果实数效率低、人工成本高、计数算法精确性差的问题,本文提出了一种改进的Yolov7的西红柿果实计数算法,采用CBAM模块对特征值进行自适应加权、强化西红柿特征并降低背景干扰,同时融合BiFPN结构以优化不同尺度特征的权重分配,高效提升特征融合效率,最终达到快速准确的识别效果.试验研究结果显示,该算法在平均计数精度(MAPE)、平均绝对误差(MAE)和均方误差(MSE)等3个关键性能指标上均显著优于其他算法,改进后的Yolov7的MAE、MSE 和 MAPE 分别达到 1.63、1.98 和 5.31%,相比于 Yolov4、Yolov5s 以及原版 Yolov7,MAE 和 MSE 分别降低了 3.24 和 3.15、2.35和2.29 以及 1.13和 1.05,计数误差率比 Yolov4、Yolov5s和 Yolov7分别减少了 3.34%、1.71%和 1.53%.
Abstract
To address the issues of low efficiency,high labor costs,and inaccurate tomato fruit counting,this paper proposed an im-proved Yolov7 tomato fruit counting algorithm.The algorithm used the CBAM module to adaptively weight the eigenvalues,enhance the tomato characteristics,and reduce the background interference.Additionally,the BiFPN structure is fused to optimize the weight distribution of features at different scales,effectively improving the feature fusion efficiency.The result was fast and accurate recognition.The experimental results indicated that the proposed algorithm outperforms other algorithms in terms of average counting accuracy,mean absolute error,and mean square error.The MAE,MSE and MAPE of the improved Yolov7 reached 1.63,1.98 and 5.31%,respectively.Compared to the Yolov4,Yolov5s and the original Yolov7,the MAE and MSE reduced by 3.24 and 3.15,2.35 and 2.29,and 1.13 and 1.05,respectively,and the counting error rate reduced by 3.34%,1.71%and 1.53%,respectively.