A Lightweight Vehicle Detection Method Fusing GSConv and Coordinate Attention Mechanism

Deqi Huang,Yating Tu,Zhenhua Zhang,Zikuang Ye
DOI: https://doi.org/10.3390/s24082394
IF: 3.9
2024-04-09
Sensors
Abstract:Aiming at the problems of target detection models in traffic scenarios including a large number of parameters, heavy computational burden, and high application cost, this paper introduces an enhanced lightweight real-time detection algorithm, which exhibits higher detection speed and accuracy for vehicle detection. This paper considers the YOLOv7 algorithm as the benchmark model, designs a lightweight backbone network, and uses the MobileNetV3 lightweight network to extract target features. Inspired by the structure of SPPF, the spatial pyramid pooling module is reconfigured by incorporating GSConv, and a lightweight SPPFCSPC-GS module is designed, aiming to minimize the quantity of model parameters and enhance the training speed even further. Furthermore, the CA mechanism is integrated to enhance the feature extraction capability of the model. Finally, the MPDIoU loss function is utilized to optimize the model's training process. Experiments showcase that the refined YOLOv7 algorithm can achieve 98.2% mAP on the BIT-Vehicle dataset with 52.8% fewer model parameters than the original model and a 35.2% improvement in FPS. The enhanced model adeptly strikes a finer equilibrium between velocity and precision, providing favorable conditions for embedding the model into mobile devices.
engineering, electrical & electronic,chemistry, analytical,instruments & instrumentation
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the large number of parameters, heavy computational burden and high application cost of the target detection model in traffic scenarios. Specifically, the author proposes an enhanced lightweight real - time detection algorithm, aiming to improve the speed and accuracy of vehicle detection. The paper mainly focuses on optimizing the YOLOv7 algorithm. By designing a lightweight backbone network, fusing GSConv and the Coordinate Attention (CA) mechanism, and using the MPDIoU loss function to optimize the model training process, the model parameters are reduced while the training speed and detection accuracy are improved. ### Main improvement points: 1. **Lightweight module**: - Replace the backbone network of YOLOv7 with the MobileNetV3 architecture to efficiently extract the feature information of the input image. - Modify the spatial pyramid parallel pooling structure to serial pooling to accelerate the detection rate. - Introduce the Generalized Sparse Convolution (GSConv) module to replace the standard convolution layer, forming the SPPFCSPC - GS module, further reducing the model parameters. 2. **Attention mechanism module**: - In order to make up for the decline in feature extraction ability after lightweighting, the coordinate attention mechanism (CA) is introduced to enhance the detection accuracy of different feature layers without significantly increasing the number of parameters. 3. **MPDIoU loss function**: - In order to optimize the detection speed of the model and reduce the bounding box regression loss, the initial CIoU loss function is replaced with the MPDIoU loss function. ### Experimental results: Experiments show that the improved YOLOv7 algorithm reaches 98.2% mAP on the BIT - Vehicle dataset, with 52.8% fewer parameters compared to the original model, and the FPS is increased by 35.2%. This indicates that the improved model achieves a better balance between speed and accuracy and is suitable for deployment on mobile devices.