• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• • 上一篇    下一篇

基于BAS-YOLOv5s的油茶果检测算法

肖伸平, 曾甲元, 赵倩颖   

  1. (1. 湖南工业大学电气与信息工程学院,湖南 株洲  412007;
    2. 湖南工业大学电气与信息工程学院,湖南 株洲  412007;
    3. 电传动控制与智能装备湖南省重点实验室,湖南 株洲  412007) 

  • 出版日期:2025-06-12 发布日期:2025-06-12

A detection algorithm based on BAS-YOLOv5s for camellia oleifera fruit

XIAO Shengping, ZENG Jiayuan, ZHAO Qianyin   

  1. (1. School of Electrical and Information Engineering,Hunan University of Technology, ZhuZhou 412007,China;
    2. School of Rail Transport,Hunan University of Technology, ZhuZhou 412007,China;
    3. Hunan Provincial Key Laboratory of Electric Drive Control and Intelligent Equipment, ZhuZhou 412007, China) 
  • Online:2025-06-12 Published:2025-06-12

摘要: 针对目前复杂环境下油茶果的识别精度较低、漏检率较高等问题,提出基于改进YOLOv5s的油茶果检测算法BAS-YOLOv5s。该算法在主干网络中利用BSAM注意力机制来提高网络的特征提取能力,改善原网络对小目标、遮挡目标的识别效果。其次,为了允许卷积核具有不规则性,提高模型的泛化能力,在结构中引入可改变核卷积。最后使用Soft-NMS代替YOLOv5s中的NMS,对目标框重新筛选,降低重叠目标误删的概率。并对改进模型进行K折交叉验证,平均F1值达到88.6%。通过所拍摄数据集的验证表明,改进后的模型平均精度达到92.3%,召回率达到84.3%,相对于原始的YOLOv5s算法分别提高2.0%和1.9%,FPS达到了82.64帧每秒,总体于其他主流算法效果较优,证明了改进方法在复杂环境下油茶果识别的有效性。

关键词: 油茶果, YOLOv5s, BSAM注意力机制, 可改变核卷积, 软性非极大值抑制

Abstract: Aiming at the current problems such as lower recognition accuracy and higher leakage rate of camellia oleifera fruit in complex environments, we propose a camellia oleifera fruit detection algorithm based on improved YOLOv5s, BAS-YOLOv5s. The algorithm utilizes the BSAM attention mechanism in the backbone network to improve the feature extraction capability of the network and to im-prove the recognition of small and occluded targets by the original network. Second, to allow the convolution kernel to be irregular and to improve the generalization of the model, alterable kernel convolution is introduced into the structure. Finally, Soft-NMS is used instead of NMS in YOLOv5s to re-filter the target frames and reduce the probability of overlapping targets being mistakenly deleted. The improved model is also cross-validated with K-fold, and the average F1 value reaches 88.6%. The validation of the photographed dataset shows that the average precision of the improved model reaches 92.3% and the recall rate reaches 84.3%, which is 2.0% and 1.9% higher than the original YOLOv5s algorithm, respectively, and the FPS reached 82.64 frames per second, which is better than other main-stream algorithms in general, and proves the effectiveness of the improved method for the recognition of camellia oleifera fruit in the complex environment. 

Key words: camellia oleifera fruit, YOLOv5s, bilevel spatial attention module, alterable kernel convolution, Soft-NMS