The study adopts a detection followed by tracking paradigm. In the detection stage, the BiFormer dynamic sparse attention module is embedded in the YOLOv8 network model, while the original nearest neighbor interpolation upsampling is improved by replacing it with the lightweight upsampling operator CARAFE. In the target tracking stage, a multi-vehicle steering trajectory tracking algorithm based on particle filtering is proposed, and the particle filtering algorithm is improved by combining the target motion direction weighted resampling algorithm. The two improved algorithms are combined for multi-vehicle detection and tracking in tunnel scenarios, and the average tracking accuracy can reach 97.3%. Compared with the traditional YOLOv8 combined with particle filtering algorithm for tracking, the method in this paper is more advantageous.