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.