Search

CN-115965831-B - Vehicle detection model training method and vehicle detection method

CN115965831BCN 115965831 BCN115965831 BCN 115965831BCN-115965831-B

Abstract

The invention discloses a vehicle detection model training method and a vehicle detection method, wherein the vehicle detection model training method comprises the steps of acquiring a training data set, wherein the training data set comprises a preset number of vehicle gray-scale images with the same size, and the vehicle gray-scale images contain vehicle position marking information; the method comprises the steps of adjusting a vehicle gray level map to different sizes, extracting corresponding HOG features to obtain HOG feature maps of different sizes, inputting the vehicle gray level map and the HOG feature maps of different sizes into a pre-constructed vehicle detection model for iterative training, and carrying out re-parameterization on the trained vehicle detection model to obtain a vehicle detection model for prediction. The scheme can simultaneously improve the real-time performance and the precision of vehicle detection, and is suitable for a light-weight vehicle monitoring system.

Inventors

  • HU ZHONGHUA
  • Chen Xuanchong
  • Qin Haolan

Assignees

  • 北京信路威科技股份有限公司

Dates

Publication Date
20260505
Application Date
20221214

Claims (5)

  1. 1. A vehicle detection model training method, adapted to be executed in a computing device, comprising: acquiring different types of vehicle images in different scenes, and marking the positions and types of vehicles in the vehicle images; Converting the acquired vehicle image into a gray scale image, and adjusting the gray scale image to the same size; Carrying out Gaussian filtering on the gray level images with the same size to obtain a preset number of vehicle gray level images with the same size; The method comprises the steps of adjusting the vehicle gray level map to different sizes, extracting corresponding HOG features to obtain HOG feature maps of different sizes, wherein the step of adjusting the vehicle gray level map to different sizes, extracting corresponding HOG features to obtain HOG feature maps of different sizes comprises the steps of adjusting the gray level map of the same size to the gray level map of different sizes, respectively extracting HOG features from the gray level maps of different sizes to obtain HOG feature data, and carrying out feature map visualization on the HOG feature data to obtain HOG feature maps of different sizes; Inputting the vehicle gray level map and HOG feature maps with different sizes into a pre-constructed vehicle detection model for iterative training; the method comprises the steps of inputting the vehicle gray level map and HOG feature maps with different sizes into a pre-built vehicle detection model for iterative training, carrying out channel combination on the vehicle gray level map and the HOG feature maps with corresponding sizes, carrying out feature extraction and downsampling on a first branch structure of an input feature extraction network to obtain a first feature map, carrying out channel combination on the first feature map and the HOG feature maps with corresponding sizes, carrying out feature extraction and downsampling on the HOG feature maps with corresponding sizes, repeating the steps until feature extraction of all levels is completed, calculating a loss function based on the target prediction category, center point bias and error between the prediction frame sizes and real values outputted by a prediction network, carrying out training when the loss value of the loss function is smaller than a preset threshold value or the iteration number reaches a preset iteration period, obtaining a trained vehicle detection model, carrying out combination after 3*3 convolution kernel and 1*1 convolution kernel filling in each branch structure, converting the branch structure into a single-path structure, obtaining a vehicle detection model for prediction, wherein the pre-built vehicle detection model comprises a cascade feature extraction model and a model for the prediction network, carrying out feature extraction and a parallel layer 3*3, carrying out feature extraction on the branch structure and a parallel layer extraction model for the feature extraction of the prediction network, and a pool of the parallel layer 3*3 of the prediction network respectively, and carrying out feature extraction model extraction and the parallel layer extraction model for the feature extraction by the parallel layer, and the parallel layer extraction model comprises the filter layer 32, and the feature extraction model is formed by the parallel layer extraction model, and the model is formed by the filter layer extraction layer 32, and the feature extraction model is obtained by the model, and the model is obtained by the model and has a model The deconvolution module comprises 3*3 convolution layers, 2 x 2 up-sampling layers and add layers.
  2. 2. A vehicle detection method, adapted to be executed in a computing device, comprising: Acquiring a vehicle picture to be detected; preprocessing the vehicle picture to be detected to obtain a vehicle gray scale picture to be detected with a preset size; The gray level images of the vehicles to be detected with the preset sizes are adjusted to be different sizes, and then corresponding HOG features are extracted to obtain HOG feature images to be detected with different sizes; Inputting a gray level map of a vehicle to be detected with a preset size and HOG feature maps to be detected with different sizes into a vehicle detection model for prediction obtained by the vehicle detection model training method according to claim 1, and carrying out prediction and feature decoding to obtain vehicle position information and type.
  3. 3. The vehicle detection method according to claim 2, wherein the step of adjusting the gray level map of the vehicle to be detected with the preset size to different sizes, and extracting the corresponding HOG features to obtain the HOG feature map to be detected with different sizes includes: sequentially scaling down the gray level images of the vehicles to be detected with preset sizes to obtain pyramid gray level images with different sizes; And calculating HOG feature vectors of the pyramid gray level map, and carrying out visualization processing on the HOG feature vectors to obtain the HOG feature map corresponding to the pyramid gray level map.
  4. 4. A computing device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor performing the vehicle detection model training method of claim 1 and the vehicle detection method of any of claims 2-3.
  5. 5. A computer-readable storage medium, comprising a computer program stored with instructions executable by a processor to load and execute the vehicle detection model training method of claim 1 and the vehicle detection method of any one of claims 2-3.

Description

Vehicle detection model training method and vehicle detection method Technical Field The invention relates to the technical field of target detection, in particular to a vehicle detection model training method, a vehicle detection method, computing equipment and a storage medium. Background The vehicle detection has important significance in the fields of intelligent transportation and unmanned driving, and along with the wide application of the computer vision technology in the traffic field, intelligent recognition equipment also develops towards miniaturization and integration, so that higher requirements are put on the performance and efficiency of a vehicle detection algorithm. The vehicle detection method in the prior art comprises the steps of directly detecting a vehicle based on an improved deep learning model such as YOLO, detecting the vehicle by using the deep learning model in combination with three-dimensional point cloud data acquired by a laser radar and a depth camera, and optimizing the deep learning model by using additional features in combination with image information and then detecting the vehicle. Most of the methods rely on NPU or GPU equipment with higher computational power, and the detection efficiency and accuracy are low when the light-weight neural network is simply used for detecting the vehicle. Therefore, there is a need for a vehicle detection model training method and a vehicle detection method that can improve the accuracy and instantaneity of vehicle detection in low-power lightweight devices to solve the above problems in the prior art. Disclosure of Invention In view of the above problems, in order to improve the accuracy of vehicle detection on low-power equipment, the present solution proposes a vehicle detection model training method, a vehicle detection method, a computing device and a storage medium, and by designing a lightweight vehicle detection network, the dependency on equipment power can be reduced while improving network detection performance, and the vehicle detection requirements of scenes such as conventional bayonets, toll booths, parking lots and entrances can be satisfied. According to a first aspect of the invention, a vehicle detection model training method is provided, wherein a training data set is firstly obtained, the training data set comprises a preset number of vehicle gray level diagrams with the same size, the vehicle gray level diagrams comprise vehicle position marking information, then the vehicle gray level diagrams are adjusted to be different in size, corresponding HOG features are extracted to obtain HOG feature diagrams with different sizes, then the vehicle gray level diagrams and the HOG feature diagrams with different sizes are input into a pre-built vehicle detection model for iterative training, and finally the trained vehicle detection model is subjected to re-parameterization to obtain a vehicle detection model for prediction. According to the vehicle detection model training method, the HOG feature map can be used as a priori feature to be added into the model for training, the influence of insufficient parameters on the performance of the model can be reduced, the detection performance of the model can be remarkably improved, and the calculated amount and the parameter amount in model prediction are reduced and the model detection speed is improved through compressing the trained model. Optionally, in the vehicle detection model training method, different types of vehicle images in different scenes can be acquired, positions and types of vehicles in the vehicle images are marked, the acquired vehicle images are converted into gray images, the gray images are adjusted to be the same size, and Gaussian filtering is performed on the gray images of the same size to obtain a preset number of vehicle gray images of the same size. Optionally, in the vehicle detection model training method, gray maps with the same size are adjusted to gray maps with different sizes, HOG features are respectively extracted from the gray maps with different sizes to obtain HOG feature data, and feature map visualization is performed on the HOG feature data to obtain HOG feature maps with different sizes. Optionally, in the vehicle detection model training method, the pre-built vehicle detection model comprises a feature extraction network and a prediction network, the feature extraction network comprises a plurality of branch structures and 3*3 pooling layers, the branch structures are composed of 3*3 convolution layers and 1*1 convolution layers in parallel, the branch structures are used for carrying out feature extraction on the vehicle gray level images after channel combination, the pooling layers are used for carrying out downsampling on the feature images after feature extraction, the prediction network comprises a deconvolution module and three branch convolution networks respectively used for outputting a thermodynamic diagram, a central p