基于YOLOv7的垃圾检测方法研究
2024,32(12):1-9
摘要:随着社会经济的发展,人们的生活水平持续提高,生活垃圾量急剧攀升。为了有效应对垃圾分拣效率低、准确率差等问题,提出一种以YOLOv7网络为基础模型的垃圾检测算法。该算法对YOLOv7网络进行了一系列改造,首先,在Head模块添加了注意力机制SimAM,增强了模型的感知能力和自适应能力,从而提高检测精度;其次,在主干网络中改进了非极大值抑制算法(soft-NMS)去除冗余的检测框,再次改进了损失函数为边框回归损失函数SIoU,提高了检测的精度和速度;最后,采用C3模块替换YOLOv7有的ELAN-W模块,提升网络对较小目标的检测能力。通过数据集对改进的网络进行测试,平均准确度为98.93%、训练时间为27.58h,高于原模型的96.31%、44.53h,实验结果也表明改进算法的检测效果有较为明显的提升。
关键词:深度学习;目标检测;注意力机制;非极大值抑制;垃圾分类
Research on Spam Detection Method Based on YOLOv7
Abstract:With the development of social economy and the continuous improvement of people"s living standard, the production of garbage has climbed dramatically. In order to effectively deal with the problems of low efficiency and poor accuracy of garbage sorting, a garbage detection algorithm based on YOLOv7 network as a base model is proposed.The algorithm carried out a series of modifications to the YOLOv7 network, firstly, the attention mechanism SimAM was added to the head module, which enhanced the model"s perceptual ability and adaptive ability so as to improve the detection accuracy; furtherly, non-maximum suppression (soft-NMS) was replaced in the backbone network to remove redundant detection frames while the loss function was improved to be the edge regression loss function SIoU, which revitalized the accuracy and speed of detection; finally, the C3 module was utilized to replace the ELAN-W module that YOLOv7 could promote the network"s ability to detect smaller targets. The proposed network was tested by the data-set, and the average accuracy is 98.93% and the training time is 27.58h, which is better than the original model"s 96.31% and 44.53h. The experimental results show that the improved algorithm has a more obvious enhancement in detection.
Key words:deep learning; target detection; attentional mechanism; non-great value suppression; spam classification
收稿日期:2023-10-10
基金项目:国家自然科学基金(62106189);陕西省高速公路施工机械重点实验室开放基金(300102250510);西安工程大学科研基金(BS201847)
