1 College of Mechanical and Transportation Engineering, Southwest Forestry University, Kunming 650224, China
2 Key Laboratory of Motor Vehicle Environmental Protection and Safety in Plateau and Mountainous Areas of Yunnan Province’s Universities, Kunming 650224, China
3 Beijing Huizhihuizhong Automotive Technology Research Institute, Beijing 100176, China
Show less
文章历史+
Received
Published
Revised
2025-04-10
2026-03-28
2025-07-27
Online Date
2026-06-02
PDF (5369K)
摘要
针对现有模型参数量高和计算量大、难以将垃圾检测模型嵌入边缘设备中的问题,提出了轻量化YOLOv8n-Garbage模型。首先,引入ContextGuided Block构建C2f-ContextGuided模块,提高模型局部和全局上下文信息联合使用;引入小波池化构建小波池化卷积(wavelet pooling-convolution,WP-Conv),更好地捕捉形状、纹理和颜色等细节信息,从而提升特征提取的能力。其次,引入加权双向金字塔网络(bidirectional feature pyramid network,BiFPN)去替换原模型的Neck部分,BiFPN通过优化多尺度特征融合机制,显著提升了模型在小目标检测任务中的表现。最后,通过共享卷积设计了基于共享卷积的检测头(detection head based on shared convolution,DHSC)轻量化检测头,使得模型轻量化的同时,还提高了精度。结果表明,YOLOv8n-Garbage比原模型YOLOv8n的参数量和浮点计算量分别下降了71.4%和49.4%,同时mAP@0.5上升了0.3%。YOLOv8n-Garbage在垃圾分类检测中有显著的优势,可以为城市垃圾智能化管理提供一定的技术支持。
Abstract
To address the issues of high model parameter counts, large computational demands, and the difficulty of embedding garbage detection models into edge devices, a lightweight YOLOv8n-Garbage model was proposed. Firstly, a ContextGuided Block was introduced to construct the C2f-ContextGuided module, enhancing the joint utilization of local and global contextual information. Additionally, wavelet pooling was incorporated to create wavelet pooling-convolution (WP-Conv), which better captures detailed information such as shape, texture, and color, thereby improving feature extraction capabilities. Secondly, a weighted bidirectional feature pyramid network (BiFPN) was introduced to replace the original model’s Neck section. By optimizing the multi-scale feature fusion mechanism, BiFPN significantly improves the model’s performance in small object detection tasks. Finally, a detection head based on shared convolution (DHSC) was designed through shared convolution, achieving both model lightweighting and accuracy improvement. The results show that YOLOv8n-Garbage reduces the parameter count and floating-point operations by 71.4% and 49.4%, respectively, compared to the original YOLOv8n model, while increasing the mAP@0.5 by 0.3%. YOLOv8n-Garbage demonstrates significant advantages in garbage classification detection, providing technical support for intelligent urban waste management.
CG Block主要有4个部分,其结构如图3所示。局部特征提取器通过3×3的普通卷积操作提取输入数据的局部特征。局部特征提取器在输入数据上滑动卷积核,捕捉图像中的细节信息(如边缘、纹理等),实现对输入数据的局部感知。周围上下文特征提取器通过3×3的膨胀卷积提取周围上下文特征。膨胀卷积能够在不增添参数量的前提下,通过扩大卷积核中的空洞,来拓宽感受野,进而捕捉到更为广泛的上下文信息。这使得模块能够更好地理解输入数据的全局结构,同时保持较少的参数量。特征融合器将来自局部特征提取器的局部特征和来自周围上下文特征提取器的周围上下文特征进行拼接(Concat)操作,并通过批归一化(batch normalization,BN)和参数化PReLU激活函数对融合后的特征进行处理。拼接操作将局部特征和上下文特征融合,形成联合特征,增强特征表示能力。批归一化(BN)能加速模型训练,提高训练稳定性。参数化(PReLU)可以增加模型的非线性表达能力,提升网络的稳健性,减少对网络架构和超参数的敏感度。全局上下文特征提取器可以对融合后的联合特征进行全局平均池化(global average pooling,GPA)和多层感知机操作,生成权重向量,并将权重与输入特征按元素相乘。GPA将每个通道的特征图压缩为一个单一的值,捕获全局上下文信息。多层感知机进一步提取和组合全局上下文信息,生成权重向量。特征加权将权重向量与输入特征按元素相乘,增强重要特征并抑制不重要的特征,最终得到全局上下文特征。
依据卷积权值共享的理念,对YOLOv8里的3组独立卷积实施合并操作。通过设计权值共享方案,构建出了基于共享卷积的检测头(detection head based on shared convolution,DHSC),结构如图7所示,将其命名为颈部网络层输出的P3、P4以及P5这3个特征层,首先会依次接受1×1卷积运算,经此处理后的特征信息会被传输至两个3×3共享卷积进行进一步运算,最后再历经三组共享卷积操作后,输出最终处理结果,这种共享参数的卷积方式可以很好地提取数据特征,降低模型的参数量和计算量。
LüFan, HaoLiping, ZhangHua, et al. Discussion on the survival potential of viruses in environmental health work environments and prevention and control of infection risks[J]. Environmental Health Engineering, 2020, 28(1): 1-9.
ZhuChunxiang, ShuHong, YangBo, et al. A low-power embedded YOLOv8-NANO intelligent garbage rapid sorting system[J]. Science Technology and Engineering, 2025, 25(9): 3806-3812.
[9]
GuoX, SunM, ZhangX, et al. Optimization and implementation of garbage classification algorithm based on YOLOv8[J]. International Core Journal of Engineering, 2024, 10(5): 1-10.
ChengHao, ChenGuangfeng. Classification and detection of ground garbage based on improved Faster R-CNN[J]. Journal of Donghua University (Natural Science Edition), 2023, 49(6): 128-134.
OuyangFei, WuXu, XiangDongsheng. Garbage classification detection method based on improved YOLOX[J]. Journal of Computers and Modernization, 2023(8): 68-73.
TangMengyu, ZengZhilin, WenYong. Research on garbage classification recognition method based on improved YOLOv8 algorithm[J]. Environmental Engineering, 2025, 43(4): 110-120.
LiuJinjun, LiLeilei, ZhangHaoyu, et al. Detection of construction garbage classification based on Improved YOLOv7 algorithm[J]. Chinese Journal of Environmental Engineering, 2024, 18(1): 270-279.
ChenJun, ZhaoXiaohui, WangBoshi, et al. Research on garbage detection method based on YOLOv7[J]. Computer Measurement & Control, 2024, 32(12): 1-8.
[24]
RedmonJ, DivvalaS, GirshickR, et al. You only look once: unified, real-time object detection[C] // 2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, NV: IEEE, 2016: 779-788.
RedmonJ, FarhadiA. YOLOv3: an incremental improvement[J]. ArXiv: 1804. 02767, 2018.
[27]
BochkovskiyA, WangC Y, LiaoH Y M. YOLOv4: optimal speed and accuracy of object detection[J]. ArXiv: 2004. 10934, 2004.
[28]
LiC Y, LiL L, JiangH L, et al. YOLOv6: a single-stage object detection framework for industrial applications[J]. arXiv: 2209. 09276, 2022.
[29]
WangC Y, BochkovskiyA, LiaoH Y M. YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]// 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Vancouver: IEEE, 2023: 7464-7475.
[30]
XuX Z, JiangY Q, ChenW H, et al. DAMO-YOLO: a report on real-time object detection design[J]. arXiv: 2211. 15444, 2022.
[31]
GeZ, LiuS T, WangF, et al. YOLOX: exceeding YOLO series in 2021[J]. ArXiv: 2107. 08430, 2021.
[32]
KongT, SunF C, LiuH P, et al. FoveaBox: beyond anchor-based object detection[J]. IEEE Transactions on Image Processing, 2020, 29: 7389-7398.
[33]
WuT Y, TangS, ZhangR, et al. CGNet: a light weight context guided network for semantic segmentation[J]. IEEE Transactions on Image Processing, 2021, 30: 1169-1179.
[34]
WilliamsT, LiR. Wavelet pooling for convolutional neural networks[C]// International Conference on Learning Representations. Vancouver, BC: The International Conference on Learning Representations, 2018, 6: 92998064.
[35]
TanM M, PangR M, LeQ V. EfficientDet: scalable and efficient object detection[C] /2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Seattle, WA: IEEE, 2019, 23(7): 10778-10787.
[36]
DetectorA. FCOS: a simple and strong anchor-free object detector[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(4): 1922-1933.