Author Login Chief Editor Login Reviewer Login Editor Login Remote Office

Computer Engineering ›› 2025, Vol. 51 ›› Issue (3): 300-309. doi: 10.19678/j.issn.1000-3428.0069208

• Development Research and Engineering Application • Previous Articles     Next Articles

Semi-Supervised Vehicle Detection Algorithm Based on Improved YOLOv5

GAO Rui1, AN Guocheng2,*(), ZOU Danping1, PEI Ling1   

  1. 1. Shanghai Key Laboratory of Beidou Navigation and Location Services, School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai 200240, China
    2. The Artificial Intelligence Research Institute of Shanghai Huaxun Network System Co., Ltd., Chengdu 610074, Sichuan, China
  • Received:2024-01-11 Online:2025-03-15 Published:2024-05-11
  • Contact: AN Guocheng

基于改进YOLOv5的半监督车辆检测算法

高睿1, 安国成2,*(), 邹丹平1, 裴凌1   

  1. 1. 上海交通大学电子信息与电气工程学院北斗导航与位置服务上海市重点实验室, 上海 200240
    2. 上海华讯网络系统有限公司行业数智事业部, 四川 成都 610074
  • 通讯作者: 安国成
  • 基金资助:
    “十四五”国家重点研发计划(2023YFC3006700); 国家自然科学基金(62273229)

Abstract:

Vehicle detection in traffic scenarios faces notable challenges, including substantial variations in target scale and severe occlusions. Additionally, fully annotating large-scale datasets involves significant costs. To address these challenges, a semi-supervised vehicle detection algorithm based on improved YOLOv5 is proposed. Firstly, the SimOTA sample matching method is integrated to refine suboptimal matches, reducing detection difficulties caused by variations in target scale and shape. A novel spatial pyramid pooling network, Spatial Pyramid Pooling Fast Attention (SPPFA), is also introduced, incorporating the Large Separable Kernel Attention (LSKA) mechanism to expand the receptive field and achieve spatial and channel adaptability. This approach effectively mitigates the impact of large-scale targets and occlusion issues. Moreover, substituting the CIoU with the SIoU enhances the regression loss function. An improved semi-supervised deep learning algorithm is also designed, optimizing the loss function to better leverage valuable information from unlabeled data and significantly improving vehicle detection accuracy. Experimental results demonstrate that the proposed algorithm achieves a mAP@0.5 of 58.2% on a custom vehicle dataset, representing an 11.1 percentage points improvement over the YOLOv5n baseline model. Additionally, the model size is significantly smaller than that of mainstream object detection algorithms, highlighting its potential for engineering applications.

Key words: YOLOv5, vehicle detection, sample matching, spatial pyramid pooling, semi-supervised learning

摘要:

目前, 交通场景中的车辆检测存在目标尺度差异显著以及遮挡重叠严重等问题, 且对大规模数据进行完全标注需要较高的成本。针对以上情况, 提出一种基于改进YOLOv5的半监督车辆检测算法。引入SimOTA样本匹配方法, 优化次优匹配现象, 改善目标尺度形状变化导致的检测困难; 提出一种新的空间金字塔池化网络SPPFA, 通过引入LSKA, 在增大感受野的同时实现空间和通道的自适应性, 缓解大尺度目标和遮挡问题产生的影响; 将CIoU替换为SIoU, 优化回归损失函数。在此基础上, 提出一种改进的半监督深度学习算法, 通过优化损失函数设计, 增强算法学习未标注样本中有益信息的能力, 有效提高模型对车辆的检测精度。实验结果表明, 改进后的算法在自制车辆数据集上mAP@0.5指标达到了58.2%, 相较YOLOv5n基线模型提升了11.1百分点, 且模型体积远小于主流目标检测算法, 具有良好的工程应用前景。

关键词: YOLOv5, 车辆检测, 样本匹配, 空间金字塔池化, 半监督学习