Author Login Chief Editor Login Reviewer Login Editor Login Remote Office

Computer Engineering ›› 2026, Vol. 52 ›› Issue (4): 252-263. doi: 10.19678/j.issn.1000-3428.0070032

• Computer Vision and Image Processing • Previous Articles     Next Articles

Vehicle Paint Defect Detection Based on Improved YOLOv8

HAO Yousheng, WEN Zhenhui, FENG Xiaoxi, DENG Zehua, HUANG Qingbao*()   

  1. School of Electrical Engineering, Guangxi University, Nanning 530000, Guangxi, China
  • Received:2024-06-24 Revised:2024-07-23 Online:2026-04-15 Published:2026-04-08
  • Contact: HUANG Qingbao

基于改进YOLOv8的车辆漆面缺陷检测

郝友胜, 文贞慧, 冯小溪, 邓泽华, 黄清宝*()   

  1. 广西大学电气工程学院, 广西 南宁 530000
  • 通讯作者: 黄清宝
  • 作者简介:

    郝友胜(CCF学生会员), 男, 硕士研究生, 主研方向为计算机视觉、多模态智能

    文贞慧, 硕士研究生

    冯小溪, 硕士研究生

    邓泽华, 硕士

    黄清宝(通信作者、CCF高级会员), 教授、博士

  • 基金资助:
    国家自然科学基金(62276072); 广西研究生教育创新计划项目(JGY2023016); 广西大学研究生教育教学改革计划

Abstract:

To address the issues of low accuracy in vehicle paint defect detection, excessive parameters in detection algorithms, and the uneven distribution of easy and hard samples, a vehicle paint detection method based on an improved YOLOv8 is proposed. To enhance scratch defect detection capabilities and reduce model size, a Deformable Attention Transformer (DAT) mechanism is introduced into the backbone network, and Ghost Convolution (GhostConv) replaces the standard Convolution (Conv) modules. Subsequently, to improve feature extraction capabilities and further reduce model size, a C2f Based on Efficient Multiscale Attention (EMA) (C2f-E) module is proposed by combining the FasterBlock module and the EMA attention mechanism. Moreover, to enhance the detection performance for small objects, a network based on the Bidirectional Feature Pyramid Network (BiFPN) is designed. Additionally, by adding a small-object detection head and a multiscale feature fusion branch, a neck pyramid structure named BiFPN with Small Object Detection Head (BiFPN-D) is proposed. Finally, to address the balance issue between difficult and easy samples and improve the detection performance for small object defects, Wise-Intersection over Union version 3 (WIoUv3) is employed as the loss function for training the network. The improved network is trained on a self-built dataset of vehicle paint defect images and subjected to comparative experiments. The results show that, the improved model achieves an increase of 5.5 percentage points in terms of mean Average Precision (mAP@0.5) and a reduction of 1.4×106 in terms of parameter count, compared to YOLOv8n.

Key words: YOLOv8 algorithm, vehicle paint defect, object detection, Bidirectional Feature Pyramid Network (BiFPN), loss function

摘要:

针对车辆漆面缺陷检测精度低、检测算法参数量大、难易样本不均匀等问题, 提出一种基于改进YOLOv8的车辆漆面检测算法。首先, 为了提升划痕状缺陷检测能力并降低模型规模, 将DAT(Deformable Attention Transformer)注意力机制引入主干网络来增强长距离特征依赖关系, 同时使用幻影卷积(GhostConv)替换网络中的卷积(Conv)模块。然后, 为了提升特征提取能力并进一步降低模型规模, 结合FasterBlock模块与高效多尺度注意力(EMA)机制提出C2f-E(C2f Based on EMA)模块。接着, 为了提高小目标检测性能, 基于双向特征金字塔网络(BiFPN)进行设计, 并增加小目标检测头与多尺度特征融合支路, 提出BiFPN-D(BiFPN with Small Object Detection Head)颈部金字塔结构。最后, 为了解决难易样本的平衡问题并提高针对小目标缺陷的检测性能, 使用WIoUv3(Wise-Intersection over Union version 3)作为训练网络的损失函数。在自建的车辆漆面缺陷数据集上进行训练并开展对比实验。实验结果表明, 相较于YOLOv8n, 改进模型的均值平均精度(mAP@0.5)提高了5.5百分点、规模减小了1.4×106

关键词: YOLOv算法, 车辆漆面缺陷, 目标检测, 双向特征金字塔网络, 损失函数