A vehicle detection model training method and a vehicle detection method

By constructing a lightweight vehicle detection network and combining HOG features with an anchorless prediction network, the problem of low vehicle detection efficiency and accuracy on low computing power devices is solved, and efficient vehicle detection on low computing power devices is achieved.

CN115965831BActive Publication Date: 2026-05-05BEIJING SIGNALWAY TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SIGNALWAY TECH
Filing Date
2022-12-14
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing vehicle detection methods have low efficiency and accuracy on low-computing-power devices, making it difficult to meet the needs of intelligent transportation and autonomous driving.

Method used

By constructing a lightweight vehicle detection network, combining HOG features and an anchorless prediction network, iterative training and reparameterization are performed to reduce the number of parameters and computational load, thereby improving detection performance.

Benefits of technology

Significantly improves the accuracy and real-time performance of vehicle detection on low-computing-power devices, meeting the vehicle detection needs of routine scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115965831B_ABST
    Figure CN115965831B_ABST
Patent Text Reader

Abstract

This invention discloses a vehicle detection model training method and a vehicle detection method. The vehicle detection model training method includes: acquiring a training dataset, which includes a predetermined number of vehicle grayscale images of the same size, each containing vehicle location annotation information; adjusting the vehicle grayscale images to different sizes and extracting corresponding HOG features to obtain HOG feature maps of different sizes; inputting the vehicle grayscale images and the HOG feature maps of different sizes into a pre-constructed vehicle detection model for iterative training; and reparameterizing the trained vehicle detection model to obtain a vehicle detection model for prediction. This solution can simultaneously improve the real-time performance and accuracy of vehicle detection and is suitable for lightweight vehicle monitoring systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, specifically to a vehicle detection model training method, a vehicle detection method, a computing device, and a storage medium. Background Technology

[0002] Vehicle detection is of great significance in the fields of intelligent transportation and autonomous driving. Moreover, with the widespread application of computer vision technology in the transportation field, intelligent recognition equipment is also developing towards miniaturization and integration, which puts forward higher requirements for the performance and efficiency of vehicle detection algorithms.

[0003] Existing vehicle detection methods include: directly detecting vehicles based on improved deep learning models such as YOLO; using deep learning models combined with 3D point cloud data acquired by LiDAR and depth cameras for vehicle detection; and optimizing deep learning models using additional features combined with image information before vehicle detection. Most of these methods rely on high-performance NPUs or GPUs, while simply using lightweight neural networks for vehicle detection often results in low efficiency and accuracy.

[0004] Therefore, there is a need for a vehicle detection model training method and a vehicle detection method that can improve the accuracy and real-time performance of vehicle detection in lightweight devices with low computing power, in order to solve the problems existing in the above-mentioned prior art. Summary of the Invention

[0005] In view of the above problems, in order to improve the accuracy of vehicle detection on low computing power devices, this solution proposes a vehicle detection model training method, a vehicle detection method, a computing device and a storage medium. By designing a lightweight vehicle detection network, the network detection performance can be improved while reducing the dependence on the computing power of the device, which can meet the vehicle detection needs of conventional checkpoints, toll stations, parking lot entrances and exits and other scenarios.

[0006] According to a first aspect of the present invention, a method for training a vehicle detection model is provided. First, a training dataset is acquired, comprising a predetermined number of vehicle grayscale images of the same size, each containing vehicle location annotation information. Then, the vehicle grayscale images are resized to different sizes, and corresponding HOG features are extracted to obtain HOG feature maps of different sizes. Subsequently, the vehicle grayscale images and the HOG feature maps of different sizes are input into a pre-constructed vehicle detection model for iterative training. Finally, the trained vehicle detection model is reparameterized to obtain a vehicle detection model for prediction.

[0007] The vehicle detection model training method provided in this solution can incorporate HOG feature maps as prior features into the model during training, which can reduce the impact of insufficient parameters on model performance and significantly improve the model's detection performance. Furthermore, by compressing the trained model, the computational load and number of parameters during model prediction are reduced, thereby increasing the model's detection speed.

[0008] Optionally, in the above vehicle detection model training method, different types of vehicle images in different scenarios can be acquired, and the vehicle positions and types in the vehicle images can be labeled; the acquired vehicle images can be converted into grayscale images, and the grayscale images can be adjusted to the same size; Gaussian filtering can be applied to the grayscale images of the same size to obtain a preset number of vehicle grayscale images of the same size.

[0009] Optionally, in the above vehicle detection model training method, grayscale images of the same size are adjusted to grayscale images of different sizes; HOG features are extracted from grayscale images of different sizes to obtain HOG feature data; and the HOG feature data are visualized to obtain HOG feature maps of different sizes.

[0010] Optionally, in the above vehicle detection model training method, the pre-built vehicle detection model includes a cascaded feature extraction network and a prediction network. The feature extraction network includes multiple branch structures composed of parallel 3*3 convolutional layers and 1*1 convolutional layers, and a 3*3 pooling layer. The branch structures are used to extract features from the grayscale image of the vehicle after channel merging, and the pooling layer is used to downsample the feature map after feature extraction. The prediction network includes a deconvolution module and three branch convolutional networks used to output the heatmap, center point offset, and prediction box size, respectively. The deconvolution module includes a 3*3 convolutional layer, a 2*2 upsampling layer, and an add layer. The number of channels in the heatmap is equal to the number of target categories to be detected.

[0011] By constructing a lightweight vehicle detection network, the accuracy of feature extraction can be improved through a branching structure. The model is trained based on the loss function of the anchorless prediction network, which eliminates the need to pre-set anchors, greatly reducing the number of network parameters and computational load.

[0012] Optionally, in the above vehicle detection model training method, the vehicle grayscale image and grayscale images of different sizes obtained after downsampling are merged with the corresponding HOG feature images; the loss function is calculated based on the target prediction category, center point bias, and error between the predicted box size and the true value output by the prediction network; training ends when the loss value of the loss function is less than a preset threshold or the number of iterations reaches a preset iteration period, and the trained vehicle detection model is obtained.

[0013] Optionally, in the above vehicle detection model training method, the 3*3 convolutional kernels and 1*1 convolutional kernels in each branch structure are filled and then merged to obtain the vehicle detection model used for prediction.

[0014] By converting the branch-structured model into a single-path model, the computational load of the model during actual deployment can be reduced, enabling the vehicle detection model to meet real-time requirements on low-computing-power devices.

[0015] According to a second aspect of the present invention, a vehicle detection method is provided, comprising: acquiring an image of a vehicle to be detected; preprocessing the image of the vehicle to be detected to obtain a grayscale image of the vehicle to be detected of a preset size; adjusting the grayscale image of the vehicle to be detected of the preset size to different sizes and extracting corresponding HOG features to obtain HOG feature maps of different sizes; inputting the grayscale image of the vehicle to be detected of the preset size and the HOG feature maps of different sizes into a vehicle detection model for prediction obtained by the above vehicle detection model training method for prediction and feature decoding to obtain vehicle location information and type.

[0016] Optionally, in the above vehicle detection method, the grayscale image of the vehicle to be detected of a preset size can be scaled down proportionally to obtain pyramid grayscale images of different sizes; the HOG feature vector of the pyramid grayscale image is calculated, and the HOG feature vector is visualized to obtain the HOG feature image corresponding to the pyramid grayscale image.

[0017] According to a third aspect of the present invention, a computing device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the vehicle detection model training method as described in the first aspect and the vehicle detection method as described in the second aspect.

[0018] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, comprising a computer program stored thereon that can be loaded by a processor and execute the vehicle detection model training method as described in the first aspect and the vehicle detection method as described in the second aspect.

[0019] According to the present invention, by adding HOG feature maps of different sizes as prior features to the model for training, the impact of insufficient parameters on model performance can be reduced, and the detection performance of the model can be significantly improved. Furthermore, by compressing the trained model, the multi-branch structure is converted into a single-path structure, thereby reducing the computational load and parameter load during model prediction, improving the model detection speed, and making it suitable for lightweight vehicle detection scenarios.

[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0022] Figure 1 A flowchart of a vehicle detection model training method 001 according to an embodiment of the present invention is shown;

[0023] Figure 2 A schematic diagram of the network structure of a pre-built vehicle detection model according to an embodiment of the present invention is shown;

[0024] Figure 3 A schematic flowchart of a vehicle detection method 300 according to an embodiment of the present invention is shown;

[0025] Figure 4 A network structure diagram of a vehicle detection model for detection according to an embodiment of the present invention is shown;

[0026] Figure 5 A structural diagram of a computing device 500 according to an embodiment of the present invention is shown. Detailed Implementation

[0027] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0028] Deep learning-based object detection algorithms have become mainstream, but deep network models often involve a large number of parameter calculations, which makes them unable to meet the needs of real-time detection. How to improve the detection speed of the model and reduce the dependence on the computing power of the device while ensuring high detection accuracy has become the key to optimizing object detection algorithms.

[0029] To achieve both lightweight vehicle detection models and improved detection accuracy, this solution proposes a vehicle detection model training method and a vehicle detection method. By constructing an ultra-lightweight vehicle detection model, during training, a multi-branch feature extraction network based on RepVGG and an anchorless Centernet prediction network are used. During model inference, reparameterization converts the multi-branch model into a single-path model, enabling the vehicle detection model deployed on the terminal to achieve high detection speed. By incorporating HOG features from images as prior features, the impact of insufficient parameters on model detection accuracy can be reduced. This solution can simultaneously improve the detection speed and accuracy of the vehicle detection model, meeting the real-time vehicle detection requirements of lightweight devices.

[0030] Figure 1 A flowchart illustrating a vehicle detection model training method 001 according to an embodiment of the present invention is shown. Figure 1 As shown, the method begins with step S010, which obtains a training dataset. The training dataset includes a predetermined number of grayscale images of vehicles of the same size, and the grayscale images of vehicles contain vehicle location annotation information.

[0031] To train the pre-built vehicle detection model, a training dataset needs to be prepared. This dataset can consist of a predetermined number of images containing vehicles from various application scenarios. For example, it can collect 10,000 images of vehicles of different types (trucks, buses, cars, etc.), colors, and models from traffic scenarios such as parking lot entrances / exits, highway toll booths, urban road networks, and vehicle surveillance videos. Then, the location information of the vehicles is labeled in the vehicle images using any annotation method, such as bounding boxes, key points, point clouds, or 3D bounding boxes.

[0032] Since most of the acquired original vehicle images are in RGB format, in order to simplify the matrix and improve the model's computation speed, it is necessary to convert and scale the acquired original vehicle images to grayscale to obtain grayscale images of the same size. For example, all vehicle grayscale images are adjusted to the same preset size of 96*96, and then Gaussian filtering is performed on the grayscale images to eliminate Gaussian noise in the images, finally obtaining a preset number of vehicle grayscale images of the same size.

[0033] The collected training dataset can be divided into training and test sets according to a certain ratio to train the model. For example, 2,000 images can be randomly selected from the collected 10,000 training images as the test set to test the accuracy of the trained model.

[0034] Then, step S020 is executed, after adjusting the vehicle grayscale image to different sizes, the corresponding HOG features are extracted to obtain HOG feature maps of different sizes.

[0035] Among them, HOG features, or Histogram of Oriented Gradients, are feature descriptors used for object detection. They are extracted by calculating and statistically analyzing the gradient orientation histograms of local image regions. Because HOG operates on local grid cells of the image, it maintains good invariance to geometric and optical deformations of the image. Therefore, HOG features are suitable for object detection in images.

[0036] Specifically, grayscale images of the same size can be resized to different sizes. For example, a 96x96 grayscale image of a vehicle can be scaled sequentially to obtain pyramid image datasets of 48x48, 24x24, and 12x12.

[0037] Then, HOG features are extracted from grayscale images of different sizes to obtain HOG feature data. First, the X-axis gradient dx and Y-axis gradient dy of the grayscale image are calculated, and the angle is calculated based on the directional gradients. Next, the grayscale image is divided into 4x4 pixel blocks and 4x4 units. A histogram is built for each unit based on the angle and weight, with each 20-degree area forming a bin (histogram interval), resulting in 9 values ​​per unit. Finally, the pixel blocks are moved within a sliding window to obtain the HOG feature vector.

[0038] Finally, the HOG feature data is visualized using feature maps to obtain HOG feature maps of different sizes. The HOG feature maps are visualized based on the bin voting results within a single cell.

[0039] Then, step S030 is executed, in which the vehicle grayscale image and HOG feature maps of different sizes are input into the pre-built vehicle detection model for iterative training.

[0040] Figure 2 A schematic diagram of the network structure of a pre-built vehicle detection model according to an embodiment of the present invention is shown. Figure 2 As shown, the pre-built vehicle detection model includes a cascaded feature extraction network and a prediction network.

[0041] The feature extraction network includes multiple branch structures consisting of parallel 3*3 convolutional layers and 1*1 convolutional layers, as well as 3*3 pooling layers. The branch structures are used to extract features from the grayscale image of the vehicle after channel merging, and the pooling layers are used to downsample the feature map after feature extraction.

[0042] The prediction network consists of a deconvolutional module and three branch convolutional networks for outputting the predicted object class, center point bias, and prediction box size, respectively. The deconvolutional module includes a 3x3 convolutional layer, a 2x2 upsampling layer, and an add layer. In other words, during training, the feature extraction network's branching structure runs in parallel with two branches: a main branch with a 3x3 kernel and a shortcut branch with a 1x1 kernel. Running multiple branches in parallel increases the model's representational power.

[0043] Reference Figure 2 The feature extraction network consists of three cascaded branch structures. Each branch structure includes parallel 3*3 convolutional layers and 1*1 convolutional layers. In the first branch structure, the stride of the convolutional layers is 1 and the padding is 4. In the second branch structure, the stride of the convolutional layers is 1 and the padding is 8. In the third branch structure, the stride of the convolutional layers is 1 and the padding is 16.

[0044] After inputting the vehicle grayscale image and HOG feature maps of different sizes into the model, the grayscale image and the corresponding HOG feature maps are first merged using the concatenate method. That is, a 96*96*1 grayscale image and a 96*96*1 HOG feature map are concatenated to obtain a 96*96*2 feature map, which is then used as the model's input image. Then, a 3*3 convolutional layer (stride 2, padding 8) is used for feature extraction, resulting in a 48*48*9 feature map.

[0045] The 48*48*1 HOG feature map and the 48*48*9 feature map are merged through a concat layer and then input into the first branch structure to obtain a 48*48*8 feature map. After passing through a 3*3 pooling layer (with a stride of 2), the 48*48*8 feature map can be downsampled into a 24*24*9 feature map.

[0046] The 24*24*1 HOG feature map and the 24*24*9 feature map are then merged through a concat layer and input into the second branch structure to obtain a 24*24*16 feature map. After passing through a 3*3 pooling layer (with a stride of 2), the 24*24*16 feature map can be downsampled to a 12*12*17 feature map.

[0047] The 12*12*1 HOG feature map and the 12*12*17 feature map are then merged through a concat layer and input into the third branch structure to obtain a 12*12*32 feature map. After passing through a 3*3 pooling layer (with a stride of 2), the 12*12*32 feature map can be downsampled into a 6*6*12 feature map.

[0048] The image then passes through a deconvolution module, consisting of a 3x3 convolutional layer (stride 1, padding 32), a 2x2 upsampling layer, and an add layer for image stitching, resulting in a 12x12x32 feature map. Finally, it passes through a 3x3 convolutional layer (stride 1, padding 16) and three branch convolutional networks to obtain the output prediction result, which includes a predicted heatmap (12x12x3), a center point offset (12x12x2), and a predicted bounding box size (12x12x2). The number of channels in the heatmap equals the number of target categories to be detected. By setting a threshold to filter the peaks in the heatmap, the final target center point can be obtained.

[0049] When calculating the loss function, the deviation between the predicted output of the three branches of the convolutional network and the true value needs to be considered separately. That is, the loss value of the predicted box size (using L1 loss), the loss value of the center point offset (using L1 loss), and the loss value of the predicted heatmap (focal loss) are weighted and summed. Training ends when the loss value of the loss function is less than the preset threshold or the number of iterations reaches the preset iteration period (e.g., 100 times).

[0050] Finally, step S040 is executed to reparameterize the trained vehicle detection model to obtain a vehicle detection model for prediction.

[0051] To simplify the model structure and reduce computational load during deployment, the trained model needs to be reparameterized. This involves filling each branch structure with 3x3 and 1x1 convolutional kernels and merging them to obtain the vehicle detection model for prediction. Converting the original branch structure to a single-path structure allows for the fusion of many operators (e.g., Conv and BN fusion), reducing computational load. Furthermore, the reduced number of operators decreases the number of convolution initiations (e.g., in a GPU, each operator execution requires a convolution initiation). The single-path model uses only 3x3 convolutions, further accelerating inference.

[0052] Once the vehicle detection model for prediction is obtained, it can be deployed on a lightweight computing device for vehicle detection. Figure 3 A schematic flowchart of a vehicle detection method 300 according to an embodiment of the present invention is shown. Figure 3 As shown, the vehicle detection method 300 begins with step S310, which involves acquiring an image of the vehicle to be detected.

[0053] The image to be detected may include multiple vehicles of different types; for example, the image may contain a truck and a car. The image is typically an RGB color image, and its size may not conform to the model's requirements. Therefore, preprocessing of the image is necessary.

[0054] Then, step S320 is executed to preprocess the image of the vehicle to be detected, and obtain a grayscale image of the vehicle to be detected with a preset size.

[0055] Image preprocessing can include grayscale transformation, brightness correction, geometric transformation, smoothing, edge detection, etc., with the aim of eliminating noise, deformation, blur and other problems in the original image in order to improve the accuracy of subsequent model predictions.

[0056] According to one embodiment of the present invention, the original image of the vehicle to be detected can be first converted to grayscale, then the image size can be adjusted to 96*96, and Gaussian filtering can be performed simultaneously to obtain a 96*96 grayscale image.

[0057] Next, step S330 is executed, where the grayscale image of the vehicle to be detected of the preset size is adjusted to different sizes and the corresponding HOG features are extracted to obtain HOG feature images of different sizes.

[0058] Specifically, the grayscale image of the vehicle to be detected of a preset size can be scaled down proportionally to obtain pyramid grayscale images of different sizes; then the HOG feature vector of the pyramid grayscale image can be calculated, and the HOG feature vector can be visualized to obtain the HOG feature map corresponding to the pyramid grayscale image.

[0059] According to one embodiment of the present invention, the grayscale image of the vehicle to be detected, which is 96*96, can be successively reduced to 48*48, 24*24, and 12*12. Then, the HOG operator is extracted using the parameters orientations=9, pixels_per_cell=(4,4), cells_per_block=(4,4)) respectively to obtain HOG feature maps of different sizes to be detected.

[0060] Finally, step S340 is executed, in which the grayscale image of the vehicle to be detected of a preset size and the HOG feature images of different sizes to be detected are input into the vehicle detection model for prediction obtained by the vehicle detection model training method described above, so as to obtain the vehicle location information and type.

[0061] Figure 4 A schematic diagram of the structure of a vehicle detection model for prediction according to an embodiment of the present invention is shown. Figure 4 As shown, the vehicle detection model used for prediction includes a feature extraction network and a prediction network. The feature extraction network includes multiple 3*3 convolutional layers and 3*3 pooling layers. The prediction network includes a deconvolution module and three branch convolutional networks for outputting the target prediction category, center point bias, and prediction box size, respectively. The deconvolution module includes a 3*3 convolutional layer, a 2*2 upsampling layer, and an add layer.

[0062] Specifically, the 96*96 grayscale image of the vehicle to be detected and the corresponding 96*96 HOG feature map to be detected are merged into channels, and then subjected to 3*3 convolution and pooling to obtain a 48*48 feature map. Then, the 48*48 feature map is merged into channels with the corresponding 48*48 HOG feature map, and then subjected to 3*3 convolution and pooling to obtain a 24*24 feature map. The 24*24 feature map is merged into channels with the corresponding 24*24 HOG feature map, and then subjected to 3*3 convolution and pooling to obtain a 12*12 feature map. The 12*12 feature map is merged into channels with the corresponding 12*12 HOG feature map, and then subjected to 3*3 convolution and pooling to obtain a 6*6 feature map.

[0063] After passing through the deconvolution module, i.e. after convolution and upsampling, a 12*12 feature map is obtained. The 12*12 feature map obtained by the feature extraction network and the 12*12 feature map obtained after upsampling are fused together. Finally, through the three branches of the prediction network, prediction result maps that respectively identify the vehicle category, center point offset and prediction box size are obtained.

[0064] Finally, feature decoding is performed on the obtained prediction result image to obtain the predicted vehicle location information and classification information. For example, the position coordinates of the vehicle in the image of the vehicle to be detected and the vehicle type, such as a truck, are obtained.

[0065] Based on the same technical concept, this application discloses a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the vehicle detection model training method 001 and the vehicle detection method 300 as described above. It should be noted that the computing device can be a low-computing-power device deployed in scenarios such as parking lot entrances / exits, road monitoring systems, and highway toll booths.

[0066] Figure 5 A structural diagram of a computing device 500 according to an embodiment of the present invention is shown. Figure 5 As shown, in the basic configuration 102, the computing device 500 typically includes a memory 106 and one or more processors 104. A memory bus 108 can be used for communication between the processors 104 and the memory 106.

[0067] Depending on the desired configuration, processor 104 can be any type of processor, including but not limited to: microprocessors (µP), microcontrollers (µC), digital information processors (DSPs), or any combination thereof. Processor 104 may include one or more levels of cache such as L1 cache 110 and L2 cache 112, processor core 114, and registers 116. Example processor core 114 may include an arithmetic logic unit (ALU), a floating-point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. Example memory controller 118 may be used with processor 104, or in some implementations, memory controller 118 may be an internal part of processor 104.

[0068] Depending on the desired configuration, memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device typically refers to volatile RAM, and data on a disk needs to be loaded into physical memory before it can be read by processor 104. Memory 106 may include operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 may be arranged to execute instructions on the operating system using program data 124 by one or more processors 104. Operating system 120 may be, for example, Linux, Windows, etc., and includes program instructions for handling basic system services and performing hardware-dependent tasks. Application 122 includes program instructions for implementing various user-desired functions, and application 122 may be, for example, a browser, instant messaging software, software development tools (such as integrated development environments IDEs, compilers, etc.), but is not limited to these. When application 122 is installed in computing device 500, driver modules may be added to operating system 120.

[0069] When the computing device 500 starts up, the processor 104 reads the program instructions of the operating system 120 from the memory 106 and executes them. The application 122 runs on the operating system 120 and uses the interfaces provided by the operating system 120 and the underlying hardware to implement various functions expected by the user. When the user starts the application 122, the application 122 is loaded into the memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the memory 106.

[0070] The computing device 500 also includes a storage device 132, which includes a removable storage device 136 and a non-removable storage device 138, both of which are connected to a storage interface bus 134.

[0071] The computing device 500 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via a bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link through one or more communication interfaces 164.

[0072] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in computer-readable instructions, data structures, or program modules in modulated data signals such as a carrier wave or other transmission mechanism, and can include any information delivery medium. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term "computer-readable medium" as used herein can include both storage media and communication media. In the computing device 500 according to the invention, application 122 includes instructions for performing the vehicle detection model training method 001 and the vehicle detection method 300 of the invention.

[0073] This application discloses a computer-readable storage medium, including a computer program that can be loaded by a processor and executed as described above in the vehicle detection model training method 001 and the vehicle detection method 300.

[0074] The computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device; the program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, or any suitable combination thereof.

[0075] The technical solution of this invention addresses two main issues. First, by incorporating HOG feature maps of different sizes as prior features into the model during training, the impact of insufficient parameters on model performance can be reduced, significantly improving the model's detection performance. Second, by using the loss function of the anchorless object detection network (CenterNet) combined with HOG feature maps and employing the concept of structural reparameterization, the high-performance advantages of multi-branch training are utilized during training, while also offering advantages in speed and memory saving during deployment. Furthermore, by compressing the trained model, the multi-branch structure is converted into a single-path structure, thereby reducing the computational load and parameter count during model prediction, improving the model's detection speed, and making it suitable for lightweight vehicle detection scenarios.

[0076] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0077] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0078] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0079] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0080] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0081] Furthermore, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing functions. Therefore, a processor having the necessary instructions for implementing a method or method element forms means for implementing that method or method element. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing functions performed by elements for the purposes of carrying out the invention.

[0082] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0083] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative rather than restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A vehicle detection model training method, suitable for execution on a computing device, characterized in that, include: Acquire images of different types of vehicles in different scenarios, and label the location and type of vehicles in the images; The acquired vehicle images are converted to grayscale images, and the grayscale images are resized to the same size. Gaussian filtering is applied to grayscale images of the same size to obtain a preset number of vehicle grayscale images of the same size; The vehicle grayscale image is adjusted to different sizes, and the corresponding HOG features are extracted to obtain HOG feature maps of different sizes. The step of adjusting the vehicle grayscale image to different sizes and extracting the corresponding HOG features to obtain HOG feature maps of different sizes includes: adjusting grayscale images of the same size to different sizes; extracting HOG features from grayscale images of different sizes to obtain HOG feature data; and visualizing the HOG feature data to obtain HOG feature maps of different sizes. The vehicle grayscale image and HOG feature maps of different sizes are input into a pre-built vehicle detection model for iterative training. This iterative training includes: merging the vehicle grayscale image and the corresponding HOG feature maps into channels, then inputting them into the first branch of the feature extraction network for feature extraction and downsampling to obtain a first feature map; merging the first feature map with the corresponding HOG feature maps into channels, then inputting them into the next-level branch for feature extraction and downsampling; repeating these steps until feature extraction at all levels is completed; calculating a loss function based on the target prediction category, center point bias, and the error between the predicted bounding box size and the true value output by the prediction network; and determining when the loss value of the loss function is less than a preset threshold or the number of iterations... Training ends when the preset iteration period is reached, resulting in a trained vehicle detection model. Then, the 3x3 and 1x1 convolutional kernels in each branch structure are filled and merged to convert the branch structure into a single-path structure, yielding a vehicle detection model for prediction. The pre-built vehicle detection model includes a cascaded feature extraction network and a prediction network. The feature extraction network includes multiple branch structures composed of parallel 3x3 and 1x1 convolutional layers and a 3x3 pooling layer. The branch structures are used to extract features from the channel-merged vehicle grayscale image, and the pooling layer is used to downsample the feature map after feature extraction. The prediction network includes a deconvolution module and three branch convolutional networks for outputting a heatmap, center point offset, and prediction box size, respectively. The deconvolution module includes a 3x3 convolutional layer, a 2x2 upsampling layer, and an add layer.

2. A vehicle detection method, suitable for execution in a computing device, characterized in that, include: Obtain images of the vehicle to be inspected; The image of the vehicle to be detected is preprocessed to obtain a grayscale image of the vehicle to be detected at a preset size; After adjusting the grayscale image of the vehicle to be detected to different sizes, the corresponding HOG features are extracted to obtain HOG feature images of different sizes. The grayscale image of the vehicle to be detected of a preset size and the HOG feature images of different sizes to be detected are input into the vehicle detection model for prediction obtained by the vehicle detection model training method as described in claim 1, so as to obtain the vehicle location information and type.

3. The vehicle detection method according to claim 2, characterized in that, The step of adjusting the grayscale image of the vehicle to be detected to different sizes and then extracting the corresponding HOG features to obtain HOG feature images of different sizes includes: The grayscale images of the vehicles to be detected, which are set to a preset size, are scaled down proportionally to obtain pyramid grayscale images of different sizes. Calculate the HOG feature vector of the pyramid grayscale image, and visualize the HOG feature vector to obtain the HOG feature map corresponding to the pyramid grayscale image.

4. A computing device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor performing the vehicle detection model training method as described in claim 1 and the vehicle detection method as described in any one of claims 2-3.

5. A computer-readable storage medium, characterized in that, It includes a computer program that can be loaded by a processor and execute the vehicle detection model training method as described in claim 1 and the vehicle detection method as described in any one of claims 2-3.

Citation Information

Patent Citations

  • Multi-characteristic layered fusion correlation filtering robustness tracking method

    CN107578423A

  • Sideline-oriented vehicle positioning method and system

    CN109993066A

  • Multi-target visual detection algorithm for automatic driving scene based on improved Center Net

    CN114581866A