Issue |
Wuhan Univ. J. Nat. Sci.
Volume 29, Number 4, August 2024
|
|
---|---|---|
Page(s) | 338 - 348 | |
DOI | https://doi.org/10.1051/wujns/2024294338 | |
Published online | 04 September 2024 |
Computer Science
CLC number: TP399
Improved YOLOv7 Algorithm for Floating Waste Detection Based on GFPN and Long-Range Attention Mechanism
基于GFPN和长程注意力机制的改进YOLOv7河面漂浮垃圾检测算法
1
School of Physics and Electrical Engineering, Weinan Normal University, Weinan 714099, Shaanxi, China
2
Engineering Research Center for X-ray Imaging and Detection of Shaanxi Provincal Universities, Weinan 714099, Shaanxi, China
† Corresponding author. E-mail: pengcheng@wnu.edu.cn
Received:
2
March
2024
Floating wastes in rivers have specific characteristics such as small scale, low pixel density and complex backgrounds. These characteristics make it prone to false and missed detection during image analysis, thus resulting in a degradation of detection performance. In order to tackle these challenges, a floating waste detection algorithm based on YOLOv7 is proposed, which combines the improved GFPN (Generalized Feature Pyramid Network) and a long-range attention mechanism. Firstly, we import the improved GFPN to replace the Neck of YOLOv7, thus providing more effective information transmission that can scale into deeper networks. Secondly, the convolution-based and hardware-friendly long-range attention mechanism is introduced, allowing the algorithm to rapidly generate an attention map with a global receptive field. Finally, the algorithm adopts the WiseIoU optimization loss function to achieve adaptive gradient gain allocation and alleviate the negative impact of low-quality samples on the gradient. The simulation results reveal that the proposed algorithm has achieved a favorable average accuracy of 86.3% in real-time scene detection tasks. This marks a significant enhancement of approximately 6.3% compared with the baseline, indicating the algorithm's good performance in floating waste detection.
摘要
河面漂浮垃圾具有尺度小、像素少、信息量低和背景复杂的特点, 容易产生误检、漏检的问题, 从而导致检测效果不佳。针对这些问题,本文提出了一种基于YOLOv7的河面漂浮垃圾检测算法, 该算法融合了改进的广义特征金字塔网络(GFPN)和长程注意力机制。首先,将YOLOv7中的Neck替换为改进的GFPN网络,从而提供更有效的信息传输, 以方便扩展到更深的网络。其次, 引入了基于卷积且硬件友好的长程注意力机制, 使算法能够快速生成具有全局感受野的注意力图。最后, 算法采用WiseIoU优化损失函数, 实现自适应梯度增益分配, 缓解低质量样本对梯度的负面影响。仿真结果表明, 所提出的算法在实时场景检测任务中取得了86.3%的平均准确率, 这比基准提高了6.3%, 表明该算法在漂浮垃圾检测方面表现优异。
Key words: floating waste detection / YOLOv7 / GFPN (Generalized Feature Pyramid Network) / long-range attention
关键字 : 河面漂浮垃圾检测 / YOLOv7 / GFPN / 长程注意力
Cite this article: PENG Cheng, HE Bing, XI Wenqiang, et al. Improved YOLOv7 Algorithm for Floating Waste Detection Based on GFPN and Long-Range Attention Mechanism[J]. Wuhan Univ J of Nat Sci, 2024, 29(4): 338-348.
Biography: PENG Cheng, male, Ph.D., research direction: image processing and computer vision. E-mail: pengcheng@wnu.edu.cn
Fundation item: Supported by the Science Foundation of the Shaanxi Provincial Department of Science and Technology, General Program-Youth Program (2022JQ-695), the Scientific Research Program Funded by Education Department of Shaanxi Provincial Government (22JK0378), the Talent Program of Weinan Normal University (2021RC20), and the Educational Reform Research Project (JG202342)
© Wuhan University 2024
This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.
Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.
Initial download of the metrics may take a while.