Abstract:Illegal parking of vehicles will reduce the efficiency of road traffic, causing traffic congestion and traffic accidents. Traditional vehicle violation detection methods have a large number of parameters and low accuracy. Therefore, this paper proposes a vehicle violation detection method using the improved YOLOv5 model and radiographic method. Firstly, a lightweight feature extraction module is designed to reduce the amount of model parameters. Secondly, the attention mechanism is added to the model to enhance the feature extraction ability of the model from the channel dimension and spatial dimension to ensure the accuracy of the model. Then, the mixed data is used to enhance the samples of the rich dataset to improve the detection effect in complex backgrounds. Then, EIoU is selected as the loss function to improve the positioning ability of the model. Experiments show that the mean accuracy of the improved model reaches 91.35%, which is 1.01% higher than that of the original YOLOv5s, and the number of parameters is reduced by 35.79%. Finally, by combining the improved model with the ray method, the inspection speed on the Jetson Xavier NX embedded platform can reach about 28 frames per second, enabling real-time inspection.