Vehicle target detection method and system based on improved SSD algorithm

By improving the SSD algorithm, using ResNet50 and parallel multi-scale receptive field module, and introducing the CBAM attention mechanism, the problem of the existing vehicle object detection algorithm being poor in detection of small objects is achieved, and higher detection accuracy and small scale are achieved Target detection effect.

CN119418292APending Publication Date: 2025-02-11CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411471771.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Existing vehicle object detection algorithms, especially the YOLO model, have poor detection effects on small targets and are difficult to meet actual needs.

Method used

The SSD algorithm is improved, ResNet50 is used as the backbone network, and the layer behind the backbone network of the original SSD algorithm is replaced as a parallel multi-scale receptive field module, and a CBAM attention mechanism module is introduced.

Benefits of technology

It significantly improves the detection accuracy of vehicle target detection, especially when small-scale target detection has better detection effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418292A_ABST
    Figure CN119418292A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle target detection method and system based on an improved SSD algorithm. The method comprises the following steps: S10, acquiring a vehicle image data set; s20, performing data enhancement processing on the data set, and training the data set after data enhancement in the improved SSD algorithm; s30, outputting a vehicle target detection result by using the trained model; the improvement of the SSD algorithm comprises the following steps: selecting ResNet50 as a backbone network, replacing a layer behind the backbone network of the original SSD algorithm with a parallel multi-scale receptive field module, and adopting a CBAM attention mechanism module. According to the method, the defects of the SSD algorithm are improved, so that the detection precision of the SSD is obviously improved, and a better detection effect is achieved during small-scale target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of vehicle target detection, and in particular relates to a vehicle target detection method and system based on an improved SSD algorithm. Background Art

[0002] Vehicle target detection is an important research direction in the field of computer vision. With the development of autonomous driving technology and the application of intelligent transportation systems, accurate and fast detection of vehicles is of great significance. In the field of autonomous driving, vehicle target detection is a key step in realizing environmental perception, path planning and decision-making, and is crucial to improving the safety and reliability of autonomous driving systems.

[0003] In the past few years, with the rapid development of deep learning technology, vehicle target detection has made significant progress, laying the foundation for safer and more efficient traffic management and intelligent transportation systems.

[0004] The YOLO model is one of the commonly used algorithm models for vehicle target detection. For example, the published patent document CN1187108870A discloses a vehicle target detection model obtained by training with the YOLOv5s network model. Although the above model has a high detection efficiency, it is not effective for detecting small targets. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention proposes a vehicle target detection method and system based on an improved SSD algorithm, which improves some deficiencies of the SSD algorithm, significantly improves the detection accuracy of the SSD, and has better detection effect for small-scale target detection.

[0006] To achieve the above purpose, the present invention adopts the following technical solutions:

[0007] A vehicle target detection method based on an improved SSD algorithm comprises the following steps: S10: acquiring a vehicle image dataset; S20: performing data enhancement processing on the dataset, and training the enhanced dataset in an improved SSD algorithm; S30: outputting vehicle target detection results using the trained model; wherein the improvement of the SSD algorithm comprises: selecting ResNet50 as a backbone network, using a parallel multi-scale receptive field module to replace the layers behind the backbone network of the original SSD algorithm, and using a CBAM attention mechanism module.

[0008] Furthermore, ResNet50 is selected as the backbone network of the SSD algorithm, and the following improvements are also included: Resnet50 retains the layer structure up to conv4_x and removes conv5_x and subsequent layer structures.

[0009] Preferably, the layer structure of Conv4_x includes Bottleneck1 and Bottleneck2, wherein Bottleneck1 remains unchanged and is not modified; and the convolution of Bottleneck2 is replaced with a dilated convolution.

[0010] Furthermore, an improved RFB module is used as a parallel multi-scale receptive field module; the parallel multi-scale receptive field module has 4 branches, one of which is a skip structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. Finally, the other three branches are concatenated and fused with the skip structure to obtain the output features.

[0011] Furthermore, the CBAM attention mechanism module generates feature maps through channel attention and spatial attention. The calculation formula is as follows:

[0012] F ′ =M c (F)×F

[0013] F ″ =M s (F ′ )×F ′

[0014] Among them, F is the input feature, F ′ is the result of the channel attention module, F ″ is the output of the spatial attention module; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F c avg is the feature after average pooling in the channel attention module, F c max It is the feature after the maximum pooling in the channel attention module;

[0015]

[0016] where f 7×7 The convolution kernel of size 7×7 is used for convolution processing. AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F s avg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

[0017] The present invention also provides a vehicle target detection system based on an improved SSD algorithm, which includes the following data acquisition module, data enhancement module, improved SSD model and detection result output module connected in sequence; wherein: the data acquisition module is used to acquire a vehicle image data set, and send the acquired vehicle image data set to the data enhancement module; the data enhancement module is used to perform data enhancement processing on the data set, and send the data enhanced data set to the improved SSD model for training; the improved SSD model is used for vehicle target detection; the detection result output module is used to output vehicle target detection results; wherein the improved SSD model includes: a ResNet50 network structure module, a parallel multi-scale receptive field module and a CBAM attention mechanism module.

[0018] Furthermore, the ResNet50 network structure module is used as the backbone network of the SSD algorithm, which retains the layer structure up to conv4_x and removes the layer structure of conv5_x and later.

[0019] Preferably, the layer structure of Conv4_x includes Bottleneck1 and Bottleneck2, where Bottleneck1 remains unchanged and is not modified; the convolution of Bottleneck2 is replaced by a dilated convolution. Furthermore, an improved RFB module is used as a parallel multi-scale receptive field module; the parallel multi-scale receptive field module has 4 branches, one of which is a jump structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. Finally, the other three branches are spliced ​​and fused with the jump structure to obtain the output features.

[0020] Furthermore, the CBAM attention mechanism module generates a feature map through the channel attention module and the spatial attention module. The calculation formula is as follows:

[0021] F ′ =M c (F)×F

[0022] F ″ =M s (F ′ )×F ′

[0023] Among them, F is the input feature, F ′ is the result of the channel attention module, F ″ is the output of the spatial attention module; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F cavg is the feature after average pooling in the channel attention module, F c max It is the feature after the maximum pooling in the channel attention module;

[0024]

[0025] where f 7×7 The convolution kernel of size 7×7 is used for convolution processing. AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F s avg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] 1. The present invention adopts an improved Resnet50 network structure, which not only deepens the depth of convolution, improves the feature extraction capability, but also solves the network degradation phenomenon caused by gradient disappearance;

[0028] 2. The present invention adopts an improved RFB (Receptive Field Block) module as the receptive field module to effectively solve the problem that the SSD algorithm has a poor detection effect on small targets. The module draws on the ideas of residual structure and dilated convolution to simulate the perception mechanism of human vision as much as possible, considers the relationship between eccentricity and receptive field size, enhances the robustness and discriminability of model features, and has better detection effect;

[0029] 3. The present invention adopts the CBAM (Convolutional Block Attention Module) attention mechanism, which combines the advantages of both the channel attention mechanism and the spatial attention mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the improved Resnet50 network structure in a specific embodiment of the present invention.

[0031] Figure 2 It is a schematic diagram of the structure of Bottleneck 1 in a specific embodiment of the present invention.

[0032] Figure 3 It is a schematic diagram of the structure of Bottleneck 2 in a specific embodiment of the present invention.

[0033] Figure 4Schematic diagram of the structure of a parallel multi-scale receptive field module in a specific embodiment of the present invention.

[0034] Figure 5 Schematic diagram of the channel attention process in the prior art.

[0035] Figure 6 Schematic diagram of the spatial attention process in the prior art.

[0036] Figure 7 Schematic diagram of the CBAM attention process in a specific embodiment of the present invention.

[0037] Figure 8 This is an improved SSD overall model framework in a specific embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] A vehicle target detection method based on an improved SSD (Single Shot MultiBox Detector) algorithm comprises the following steps: S10: acquiring a vehicle image dataset; S20: performing data enhancement processing on the dataset, and training the enhanced dataset in an improved SSD algorithm; S30: outputting vehicle target detection results using the trained model; wherein the improvement of the SSD algorithm comprises: selecting ResNet50 as a backbone network, using a parallel multi-scale receptive field module to replace the layers behind the backbone network of the original SSD algorithm, and using a CBAM attention mechanism module.

[0040] The vehicle image data can be taken by a vehicle camera, a road monitoring camera, downloaded from a public dataset, or a hybrid of the above methods.

[0041] Data augmentation processing of the data set includes image flipping, rotation, scaling and cropping, translation, transformation, etc., which can enhance the generalization ability and robustness of the model and prevent overfitting. The data augmented data set is trained in the improved SSD algorithm.

[0042] The original SSD (Single Shot MultiBox Detector) network uses VGG16 (Visual Geometry Group) as the backbone network for feature extraction. The number of convolution layers in VGG16 is relatively small, which leads to its low feature extraction capability. If the number of convolution layers of VGG is deepened in order to improve the feature extraction capability of the backbone network, the problem of gradient disappearance may occur. The ResNet (Residual Network) network model can solve this problem well. It not only deepens the depth of convolution, improves the feature extraction capability, but also solves the network degradation phenomenon caused by gradient disappearance. Therefore, the present invention adopts ResNet50 as the backbone network and improves it.

[0043] The present invention makes some modifications to the Resnet50 network structure. The modified structure is as follows Figure 1 As shown, Resnet50 only needs to retain the layer structure up to conv4_x and remove the layer structure of conv5_x and later. Figure 1 Layer1 and Layer2 in the figure correspond to Conv2_x and Conv3_x in the network. The layer structure of Conv4_x in the figure corresponds to Layer3. The present invention makes a modification to Layer3, and Bottleneck1 in Layer3 remains the same without modification. Bottleneck2 is improved by replacing its convolution with a dilated convolution, where r in the 3×3 convolution layer represents the dilation coefficient. When r=1, it is the same as the ordinary convolution, and r=2 means that the spacing between the convolution kernels is 2. The structures of Bottleneck1 and Bottleneck2 are shown in the figure. Figure 2 and Figure 3 shown.

[0044] In the process of target detection, there may be too many small targets. Although the SSD algorithm is better than the YOLO algorithm in detecting small targets, it still cannot meet the actual needs. To solve this problem, the RFB (Receptive Field Block) module can effectively alleviate it. This module draws on the ideas of residual structure and dilated convolution to simulate the perception mechanism of human vision as much as possible, considers the relationship between eccentricity and receptive field size, and enhances the robustness and discriminability of model features. In order to achieve better detection results, some improvements are made to it. The improved structure is as follows: Figure 4 shown.

[0045] In a specific embodiment of the present invention, Figure 4As shown in the figure, the receptive field module has 4 branches. The rightmost branch is a jump structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. The third branch is initially processed by 5×5 convolution. Here, two 3×3 convolutions are used to replace the 5×5 convolution. This allows the network to have the same receptive field size while reducing the number of network calculation parameters. Finally, the three branches on the left are concatenated and added and fused with the jump structure to obtain the output features. This structure replaces the layers behind the original SSD algorithm backbone network to improve the feature extraction capability of the previous backbone network.

[0046] Attention mechanisms can generally be divided into two types: one is the channel attention mechanism and the other is the spatial attention mechanism. CBAM (Convolutional Block Attention Module) combines these two attention mechanisms.

[0047] Channel attention is mainly used to focus on whether the input image has the characteristics of the detection target, such as Figure 5 As shown. The input feature F is generated into two one-dimensional feature maps through maximum pooling and average pooling, and a one-dimensional channel feature map Mc∈R is generated through a perceptron with shared weights. C×1×1 , calculation formula:

[0048] Where σ is the sigmoid activation function, and W1 and W0 are the weights of the shared neural network.

[0049] Spatial attention is mainly used to focus on the information of the location of the detection target, such as Figure 6 As shown. The feature map M generated by channel attention c Multiply it with the input feature F to generate the input feature F of spatial attention ′ , use the maximum pooling and average pooling operations to generate two one-dimensional feature maps, concatenate them, reduce them to one dimension through the convolution operation, and finally generate the spatial feature map M through the activation function S ∈R 1×H×W ,H×W represents the pixel size, and the calculation formula is as follows:

[0050]

[0051] where f 7×7 The convolution process is performed with a convolution kernel of size 7×7.

[0052] The overall process of CBAM attention used in the present invention is as follows Figure 7As shown, the feature map is generated by channel attention and spatial attention in turn. The calculation formula is as follows:

[0053] F ′ =M c (F)×F

[0054] F ″ =M s (F ′ )×F ′

[0055] Among them, F is the input feature, which is a H×W×C feature, F ′ is the result of channel attention, F ″ It is the output result after spatial attention; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F c max It is the feature after the maximum pooling in the channel attention module;

[0056]

[0057] where f 7×7 The convolution kernel of size 7×7 is used for convolution processing. AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F s avg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

[0058] The present invention improves some of the shortcomings of the SSD algorithm, significantly improving the detection accuracy of the SSD and achieving better detection results for small-scale targets. The improved SSD overall model framework is as follows: Figure 8 shown.

[0059] The present invention also provides a vehicle target detection system based on an improved SSD algorithm, which includes the following data acquisition module, data enhancement module, improved SSD model and detection result output module connected in sequence; wherein: the data acquisition module is used to acquire a vehicle image data set, and send the acquired vehicle image data set to the data enhancement module; the data enhancement module is used to perform data enhancement processing on the data set, and send the data enhanced data set to the improved SSD model for training; the improved SSD model is used for vehicle target detection; the detection result output module is used to output vehicle target detection results; wherein the improved SSD model includes: a ResNet50 network structure module, a parallel multi-scale receptive field module and a CBAM attention mechanism module.

[0060] Furthermore, the ResNet50 network structure module is used as the backbone network of the SSD algorithm, which retains the layer structure up to conv4_x and removes the layer structure of conv5_x and later.

[0061] Preferably, the layer structure of Conv4_x includes Bottleneck1 and Bottleneck2, wherein Bottleneck1 remains unchanged and is not modified; and the convolution of Bottleneck2 is replaced with a dilated convolution.

[0062] Furthermore, the improved RFB module is used as the parallel multi-scale receptive field module; the parallel multi-scale receptive field module has four branches, such as Figure 4 As shown in the figure, the rightmost branch is a skip structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. Finally, the three branches on the left are concatenated and fused with the skip structure to obtain the output features.

[0063] Furthermore, the CBAM attention mechanism module generates feature maps through channel attention and spatial attention. The calculation formula is as follows:

[0064] F ′ =M c (F)×F

[0065] F ″ =M s (F ′ )×F ′

[0066] Among them, F is the input feature, F ′ is the result of channel attention, F ″ It is the output result after spatial attention; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F c avg is the feature after average pooling in the channel attention module, F c max It is the feature after the maximum pooling in the channel attention module;

[0067]

[0068] where f 7×7 The convolution kernel of size 7×7 is used for convolution processing. AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F savg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

[0069] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0070] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A vehicle target detection method based on an improved SSD algorithm, characterized in that: The following steps are involved: S10: Acquire vehicle image dataset; S20: Perform data enhancement processing on the data set, and train the data enhanced data set in the improved SSD algorithm; S30: Output vehicle target detection results using the trained model; Among them, the improvements of the SSD algorithm include: selecting ResNet50 as the backbone network, using a parallel multi-scale receptive field module to replace the layers behind the original SSD algorithm backbone network, and using a CBAM attention mechanism module.

2. The vehicle target detection method based on the improved SSD algorithm according to claim 1, characterized in that: Select ResNet50 as the backbone network of the SSD algorithm. The following improvements are included: Resnet50 retains the layer structure up to conv4_x, and removes the layer structure of conv5_x and later.

3. The vehicle target detection method based on the improved SSD algorithm according to claim 2 is characterized in that: The layer structure of Conv4_x includes Bottleneck1 and Bottleneck2, where Bottleneck1 remains unchanged and the convolution of Bottleneck2 is replaced with a dilated convolution.

4. The vehicle target detection method based on the improved SSD algorithm according to claim 1, characterized in that: The improved RFB module is used as the parallel multi-scale receptive field module; The parallel multi-scale receptive field module has 4 branches, one of which is a skip structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. Finally, the other three branches are concatenated and fused with the skip structure to obtain the output features.

5. The vehicle target detection method based on the improved SSD algorithm according to claim 1, characterized in that: The CBAM attention mechanism module generates features through the channel attention module and the spatial attention module. The calculation formula is as follows: F ′ =M c (F)×F F ″ =M s (F ′ )×F ′ Among them, F is the input feature, F ′ is the result of the channel attention module, F ″ is the output of the spatial attention module; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F c avg is the feature after average pooling in the channel attention module, F c max It is the feature after the maximum pooling in the channel attention module; where f 7×7 Indicates that the convolution kernel of size 7×7 is used for convolution processing, AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F s avg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

6. A vehicle target detection system based on an improved SSD algorithm, characterized in that: It includes the following sequentially connected data acquisition module, data enhancement module, improved SSD model and detection result output module; in: The data acquisition module is used to acquire a vehicle image dataset and send the acquired vehicle image dataset to the data enhancement module; The data enhancement module is used to perform data enhancement processing on the data set and send the data enhanced data set to the improved SSD model for training; The trained improved SSD model is used for vehicle target detection; The detection result output module is used to output the vehicle target detection result; Among them, the improved SSD model includes: ResNet50 network structure module, parallel multi-scale receptive field module and CBAM attention mechanism module.

7. The vehicle target detection system based on the improved SSD algorithm according to claim 6 is characterized in that: The ResNet50 network structure module is used as the backbone network of the SSD algorithm. It retains the layer structure up to conv4_x and removes the layer structure of conv5_x and later.

8. The vehicle target detection system based on the improved SSD algorithm according to claim 7, characterized in that: The layer structure of Conv4_x includes Bottleneck1 and Bottleneck2, where Bottleneck1 remains unchanged and the convolution of Bottleneck2 is replaced with a dilated convolution.

9. The vehicle target detection system based on the improved SSD algorithm according to claim 6, characterized in that: The improved RFB module is used as the parallel multi-scale receptive field module; the parallel multi-scale receptive field module has 4 branches, one of which is a skip structure that retains the original feature information. The other three branches initially use 1×1 convolution to reduce the number of channels, and then use 3×3 convolution to reduce parameters, but the expansion rates between their convolution kernels are different. Finally, the other three branches are concatenated and fused with the skip structure to obtain the output features.

10. The vehicle target detection system based on the improved SSD algorithm according to claim 6, characterized in that: The CBAM attention mechanism module generates a feature map through the channel attention module and the spatial attention module. The calculation formula is as follows: F ′ =M c (F)×F F ″ =M s (F ′ )×F ′ Among them, F is the input feature, F ′ is the result of the channel attention module, F ″ is the output of the spatial attention module; Where σ is the sigmoid activation function, W1 and W0 are the weights of the shared neural network, and F c avg is the feature after average pooling in the channel attention module, F c max It is the feature after the maximum pooling in the channel attention module; where f 7×7 The convolution kernel of size 7×7 is used for convolution processing. AvgPool(F) is the global average pooling, MaxPool(F) is the global maximum pooling, and F s avg is the feature after average pooling in the spatial attention module, F s max It is the feature after maximum pooling in the spatial attention module.

Citation Information

Cited By

  • A workpiece positioning method and system based on machine vision

    CN119784763A