|国家科技期刊平台
首页|期刊导航|湖南农业大学学报(自然科学版)|基于自注意力机制和改进YOLOv5s的小目标生物检测

基于自注意力机制和改进YOLOv5s的小目标生物检测OA北大核心CSTPCD

Small target biological detection based on self-attention mechanism and improved YOLOv5s

中文摘要英文摘要

为了快速准确地检测出小目标生物(海参、扇贝、海星和海胆)在复杂水下环境的位置及所属种类,提出一种基于改进YOLOv5s的小目标生物检测算法.在特征提取阶段,引入基于多头自注意力设计的自注意力残差模块,强化网络全局建模能力的同时,强化目标特征信息;在特征融合阶段,将特征融合网络调整为添加横向连接的双向特征金字塔结构,增强网络融合不同阶段特征信息的能力;在检测阶段,舍弃大目标检测尺度并添加小目标的检测尺度,提升小目标生物的检测精度;最后,引入α-CIoU损失函数作为模型边界框回归损失函数,提高边界框回归精度,进而提高算法检测准确率.定性试验中,几乎所有肉眼可见的水产品目标都被改进模型检出,并正确标记,体现了改进算法的有效性.α值选取试验中,α值为2.0时效果最佳,平均精度均值(mAP)均优于其他值的,达到 0.857,较α值为 1.0时的提升了 0.016.消融试验中,添加任一优化方法均会提升改进模型的检测精度,最终改进模型的mAP达0.873,较原模型的提升了0.032,模型参数量减少了26.8%,仅有5 M.对比试验中,改进模型的mAP较Faster RCNN、YOLOv3、YOLOv4、YOLOv5s、YOLOvX、SSD、NAS-FCOS、改进YOLOv5等的提升了0.020以上;改进模型在本地服务器的检测速度达139帧/s,较YOLOv5s的提升了14帧/s,略逊于以检测速度著称的SSD模型的.可见,改进模型能满足轻量和实时性要求.改进模型也成功部署到安卓移动设备中.

In order to quickly and accurately detect the location and species of small target organisms(sea cucumbers,scallops,starfish and sea urchins)in complex underwater environments,a small target organism detection algorithm based on improved YOLOv5s was designed in this study.In the feature extraction stage,a self-attention residual module based on multi-head self-attention design was introduced to enhance the global modeling ability of the network while enhancing the target feature information;in the feature fusion stage,the feature fusion network was adjusted to a bidirectional feature pyramid structure with lateral connections to enhance the network's ability to fuse feature information at different stages;in the detection stage,the large target detection scale was discarded and the small target detection scale was added to improve the detection accuracy of small target organisms;finally,the α-CIoU loss function was introduced as the model bounding box regression loss function to improve the bounding box regression accuracy,thereby improving the algorithm detection accuracy.In the qualitative test,almost all aquatic product targets visible to the naked eye were detected and correctly marked by the improved model,which reflects the effectiveness of the improved algorithm.In the α value selection test,the best effect was achieved when the α value was 2.0,and the mean average precision(mAP)was better than other values,reaching 0.857,which was 0.016 higher than that when the α value was 1.0.In the ablation experiment,adding any optimization method increased the detection accuracy of the improved model.The mAP of the improved model finally reached 0.873,which was 0.032 higher than that of the original model,and the number of model parameters was reduced by 26.8%,only 5 M.In the comparative experiment,the mAP of the improved model was improved by more than 0.020 compared with Faster RCNN,YOLOv3,YOLOv4,YOLOv5s,YOLOvX,SSD,NAS-FCOS,and improved YOLOv5;and the detection speed of the improved model on the local server reached 139 frames/s,which was 14 frames/s higher than that of the YOLOv5s,slightly lower than that of the SSD model known for its detection speed.It could be concluded that the improved model meets the requirements of lightweight and real-time performance.The improved model was also successfully deployed on Android mobile devices.

戚学通;袁红春

上海海洋大学信息学院,上海 201306

水产学

小目标生物检测YOLOv5s自注意力机制α-CIoU损失双向特征金字塔移动设备部署

small target biological detectionYOLOv5sself-attention mechanismα-CIoU lossbidirectional feature pyramidmobile device deployment

《湖南农业大学学报(自然科学版)》 2024 (003)

108-114 / 7

国家自然科学基金项目(41776142)

10.13331/j.cnki.jhau.2024.03.016

评论