Vehicle target detection method and device, electronic equipment and storage medium
By employing a multi-channel attention mechanism, global average pooling, and non-linear activation function processing, combined with feature fusion and angular dimension bounding box annotation, the problem of low efficiency and low accuracy in vehicle target detection in remote sensing images is solved, achieving fast and accurate vehicle target localization.
Patent Information
- Application Number
- CN202210761573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-06-29
AI Technical Summary
Existing technologies for vehicle target detection in remote sensing images are inefficient and inaccurate, and rely on manual feature extraction, making it difficult to quickly and accurately locate vehicle targets in complex backgrounds.
A multi-channel attention mechanism is used for feature extraction, combined with global average pooling and non-linear activation function processing. Feature fusion is performed through upsampling or downsampling, and rectangular boxes in the angular dimension are introduced to mark the vehicle positions. A weighted bidirectional feature pyramid network is used for information fusion.
It improves the speed and accuracy of vehicle target detection in remote sensing images, and can quickly and accurately locate vehicle targets in remote sensing images with a large field of view, especially effectively improving the detection effect when vehicles are parked densely.
Smart Images

Figure CN115170978B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to vehicle target detection methods, devices, electronic equipment, and storage media. Background Technology
[0002] In recent years, with the development of target detection technology, various remote sensing image target detection methods have emerged. Traditional methods often use shallow feature representations to detect targets. The steps of traditional target detection algorithms are: first, region selection. In remote sensing images, the location of targets is random, and the aspect ratio and size of the targets cannot be accurately determined. Therefore, a sliding window algorithm is usually used to traverse the image. Although this method traverses the entire image, it is obviously time-consuming and laborious, and generates many redundant windows, which seriously reduces the efficiency of subsequent work.
[0003] In previous methods, researchers typically extracted vehicle features manually and then classified them to detect vehicles in remote sensing images. Vehicle feature extraction and classification using classic machine learning techniques were the main steps. Commonly used features include HOG and SIFT. Besides the variable shape of targets, remote sensing images also have complex backgrounds; therefore, the quality of the features directly affects the accuracy of subsequent classification. When the number of feature points is limited, the SIFT algorithm remains stable under changes in viewpoint and noise, and also remains unchanged by changes in target position and brightness. However, the huge computational cost of SIFT affects detection efficiency.
[0004] Grayscale conversion is an indispensable step in HOG feature generation. While this operation avoids the influence of lighting and color on the image, it reduces the dimensionality of the image data, making HOG features difficult to handle occlusion issues. Then, methods such as Ababoost are used to classify the image to obtain the detection results. Ababoost can divide multiple classification methods into weak classifiers and cascade them in parallel, effectively balancing the weights of each classifier. However, the number of iterations is difficult to determine, and the training cycle is long. Its accuracy decreases when the data is imbalanced. Many algorithms use manually selected features for image classification, achieving good results in general specific situations. However, these algorithms are difficult to generalize to other scenarios and are difficult to apply to remote sensing images that are easily affected by environmental changes. Furthermore, the structure of these algorithms is not end-to-end, making the entire detection process relatively slow. Summary of the Invention
[0005] This invention provides a vehicle target detection method, apparatus, electronic device, and storage medium to address the shortcomings of existing technologies, such as slow target detection efficiency, low accuracy, and reliance on manual labor, thereby meeting the actual needs of vehicle target detection in remote sensing images.
[0006] This invention provides a vehicle target detection method, comprising: extracting image features from the image to be detected using a multi-channel attention mechanism to obtain a multi-dimensional feature map; performing global average pooling and non-linear activation function processing on the multi-dimensional feature map to obtain an enhanced feature map; wherein the enhanced feature map includes feature layers of multiple scales; fusing information from the feature layers of multiple scales by adding upsampling or downsampling processing to obtain fused features; and marking the position of the target vehicle on the image to be detected using a bounding box, wherein the bounding box parameters include the angle dimension.
[0007] According to a vehicle target detection method provided by the present invention, a feature map is subjected to global average pooling and nonlinear activation function processing to obtain an enhanced feature map. The method includes: performing global average pooling on the multi-dimensional feature map to obtain pooled data; performing dimensionality reduction processing on the pooled data, then performing dimensionality increase through an FC layer under the activation of the ReLU function, and finally using the Sigmoid activation function to obtain the weights of each channel; and obtaining the enhanced feature map based on the multi-dimensional feature map and the weights of each channel.
[0008] According to a vehicle target detection method provided by the present invention, information fusion is performed on feature layers of multiple scales by adding upsampling or downsampling processing to obtain fused features. The method includes: performing convolution and downsampling processing on feature layers of multiple scales to obtain first parameters and second parameters; inputting the first parameters and second parameters into a weighted bidirectional feature pyramid network to obtain fused features; wherein, the weighted bidirectional feature pyramid network is a bidirectional feature fusion channel from top to bottom and from bottom to top, and there are lateral connection paths between feature layers of the same scale.
[0009] According to a vehicle target detection method provided by the present invention, the graphic frame includes a rectangular frame. Based on fusion features, the position of the target vehicle is marked on the image to be detected using the graphic frame, including: adding an angle dimension to the parameters of the rectangular frame, and marking the position of the target vehicle using a rectangular frame including horizontal axis parameters, vertical axis parameters, length parameters, width parameters and angle parameters.
[0010] According to a vehicle target detection method provided by the present invention, before adding the angle dimension to the parameters of the bounding box, the method further includes: based on the predicted value y i The true value σ(x) i The total number of samples n determines the loss and σ(a); where loss and σ(a) are the angle classification losses of the angle dimension.
[0011] According to the vehicle target detection method provided by the present invention, the formulas for calculating loss and σ(a) are as follows:
[0012]
[0013] According to a vehicle target detection method provided by the present invention, the position of the target vehicle is marked on the image to be detected using a bounding box based on fused features. The method includes: when the position of the target vehicle marked by the bounding box is repeated, calculating the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss; and marking the position of the target vehicle on the image to be detected using a rectangular box based on the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss.
[0014] The present invention also provides a vehicle target detection device, comprising: a feature extraction module for extracting image features from an image to be detected using a multi-channel attention mechanism to obtain a multi-dimensional feature map; a feature enhancement module for performing global average pooling and non-linear activation function processing on the multi-dimensional feature map to obtain an enhanced feature map; wherein the enhanced feature map includes feature layers of multiple scales; a feature fusion module for fusing information from the feature layers of multiple scales by adding upsampling or downsampling processing to obtain fused features; and a target vehicle module for marking the position of the target vehicle on the image to be detected using a bounding box based on the fused features, wherein the bounding box parameters include angular dimensions.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the vehicle target detection methods described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the vehicle target detection methods described above.
[0017] The vehicle target detection method, device, electronic device, and storage medium provided by this invention, by introducing a multi-channel attention mechanism, global average pooling processing, and nonlinear activation function processing, can automatically determine the importance of different feature channels, effectively increasing the importance of useful features and suppressing relatively ineffective features, thus helping the network learn and extract more meaningful features of vehicle targets. In the feature fusion stage, by adding upsampling or downsampling processing, vehicle target features from remote sensing images of different resolutions are fused, which can improve the detection accuracy of the model. By introducing an angular dimension, the problem of poor detection results caused by densely parked vehicle targets in remote sensing images can be effectively solved. In summary, the vehicle target detection method based on deep convolutional networks proposed in this invention can quickly and accurately locate targets in remote sensing images with a large field of view. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating an embodiment of the vehicle target detection method of the present invention;
[0020] Figure 2 This is a structural flowchart of an embodiment of the SE module of the present invention;
[0021] Figure 3 This is a schematic diagram of the structure of an embodiment of the weighted bidirectional feature pyramid network of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of an embodiment of the improved feature fusion of the present invention;
[0023] Figure 5 This is a schematic diagram of an embodiment of the SkewIoU calculation method of the present invention;
[0024] Figure 6 This is a schematic diagram of the structure of an embodiment of the improved YOLOv5 of the present invention;
[0025] Figure 7 This is a schematic diagram of the structure of an embodiment of the vehicle target detection device of the present invention;
[0026] Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0028] With the development of satellite remote sensing technology, the resolution of remote sensing images has improved, enabling the clear display of many scenes and targets. However, due to the large data volume and complex target environments of satellite remote sensing images, how to quickly and accurately locate targets in large field-of-view remote sensing images remains a hot topic. Vehicles are important means of transportation in both civilian and military fields, and are also important targets for remote sensing target detection. However, compared to natural images, remote sensing images are larger in size, have complex backgrounds, and are influenced by factors such as the shape, position, and size of vehicle targets. Existing target detection methods for natural scenes cannot guarantee detection accuracy. Therefore, this invention provides a vehicle target detection method.
[0029] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the vehicle target detection method of the present invention. In this embodiment, the vehicle target detection method may include steps S110 to S140, and the specific steps are as follows:
[0030] S110: Utilizes a multi-channel attention mechanism to extract image features from the image to be detected, obtaining a multi-dimensional feature map.
[0031] This embodiment is based on the YOLOv5 network, with some improvements. In this embodiment, an SE (Squeeze-and-Excitation) module is added to the YOLOv5 network. The SE module is simple in concept, easy to implement, and also has good portability. Please refer to... Figure 2 , Figure 2 This is a structural flowchart of an embodiment of the SE module of the present invention.
[0032] The multi-channel attention mechanism involves multiple convolutional operations, which can yield deeper feature information. Although the features extracted from the multiple channels are different, the YOLOv5 network considers these features to be of equal importance, and all extracted features play the same role in the final detection task. However, in reality, the importance of the features extracted from each layer is different. Therefore, subsequent operations are needed to allocate the weights of each channel.
[0033] S120: Perform global average pooling and non-linear activation function processing on the multi-dimensional feature map to obtain the enhanced feature map.
[0034] The enhanced feature map includes feature layers at multiple scales. After global average pooling, a global receptive range can be obtained, reducing the feature map size during the first fully connected operation, thereby reducing parameters and computational workload. Then, after passing through a non-linear activation function, a second fully connected operation is performed to restore the number of channels to their original value, completing the modeling of the dependencies between channel features.
[0035] In some embodiments, the step of performing global average pooling and non-linear activation function processing on a multi-dimensional feature map to obtain an enhanced feature map specifically includes:
[0036] Global average pooling is performed on the multi-dimensional feature map to obtain pooled data; the pooled data is then dimensionality-reduced by performing FC layer dimensionality increase under ReLU activation, and finally the Sigmoid activation function is used to obtain the weights of each channel; based on the multi-dimensional feature map and the weights of each channel, an enhanced feature map is obtained.
[0037] Among them, FC layer refers to Fully connected layer; ReLU function is full name for Rectified Linear Unit activation function. The ReLU function simply sets the threshold at zero, which greatly reduces the computational cost and helps to improve the effect.
[0038] For example, when a feature map with dimensions (b,c,h,w) is subjected to global average pooling operation as shown in formula (1), the size of the feature map is converted to (b,c,h,w), that is, h*w of each layer will be averaged into a single value.
[0039]
[0040] Zc represents the global information of the feature map. b: batch size, i.e., the number of images input at one time; c: channel, i.e., the three channels R, G, and B (red, green, and blue); h: height; w: weight, i.e., width; F sq (U c ) refers to squeeze (compression operation), Uc refers to multiple feature maps; i∈h, j∈w.
[0041] Next, the importance of each feature map is learned. The dimensionality reduction operation is performed on the vector (b,c,1,1) after global average pooling. Then, with ReLU activation, a fully connected (FC) layer is used to increase the dimensionality. Finally, the Sigmoid activation function is used to obtain the weights of each channel. The dimensionality increase and decrease operations of the FC layer have more non-linearity, which can well simulate the complex correlations between channels.
[0042] Finally, the features obtained from the extracted image are multiplied by the weights of the corresponding channels to obtain the final output. As the channel weights increase, the value of the feature map also increases, thus increasing its impact on the final output. Conversely, when the weights are small, the value of the feature map decreases accordingly, and its impact on the final output also decreases.
[0043] S130: By adding upsampling or downsampling processing, information from feature layers at multiple scales is fused to obtain fused features.
[0044] In some embodiments, the step of fusing information from feature layers at multiple scales by adding upsampling or downsampling processing to obtain fused features specifically includes:
[0045] The first and second parameters are obtained by convolution and downsampling of feature layers at multiple scales. The first and second parameters are then input into a weighted bidirectional feature pyramid network to obtain fused features. The weighted bidirectional feature pyramid network is a bidirectional feature fusion channel that is both top-down and bottom-up, and there are lateral connection paths between feature layers at the same scale.
[0046] By adding upsampling or downsampling to unify the scale, feature information from different scales can be fused. Furthermore, adding lateral connections between feature layers at the same scale can prevent the transmission of feature information from being affected by the large number of network layers. Please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of an embodiment of the weighted bidirectional feature pyramid network of the present invention.
[0047] exist Figure 3 In the diagram, P3, P4, and P5 are the first parameters, while P6 and P7 are the second parameters. P3, P4, and P5 are obtained by convolving three feature maps C3, C4, and C5 after the Darknet53 feature extraction network; P6 and P7 are obtained by performing two downsampling operations.
[0048] C3-C5 are feature maps, which are obtained after the network undergoes convolution and pooling. The information on the feature maps is assumed to be equal, and the useful feature information can be enhanced after the multi-channel attention mechanism is applied.
[0049] Figure 3 The first column shows the feature layers extracted by the backbone network and the feature layers obtained through two downsampling operations. The second column presents the top-down feature fusion path, which is obtained after convolution operations.
[0050] P7_in, P6_in, P5_in_1, P5_in_2, P4_in_1, P4_in_2, P3_in, such as Figure 3As shown, firstly, P7_in is upsampled and then weighted and fused with P6_in, the result being denoted as P6_td; then P6_td is upsampled and weighted and fused with P5_in_1, the result being denoted as P5_td; then P5_td is upsampled and then weighted and fused with P4_in_1, the result being denoted as P4_td; then P4_td is upsampled and then weighted and fused with P3_in, the result being denoted as P3_out. The third column shows the bottom-up path, at which point the data obtained includes:
[0051] The first weighted feature fusion is performed on nodes P3_out, P4_td, P4_in_2, P5_td, P5_in_2, P6_td, P6_in, and P7_in. Then, P3_out is downsampled, and the result is weighted and fused with P4_td and P4_in_2, resulting in P4_out. The same process is repeated for P4_out, P5_out, P6_td, and P6_in. Finally, P6_out is downsampled, and the result is weighted and fused with P7_in, resulting in P7_out. This completes the first weighted feature fusion. Nodes with only one input or output channel typically contain less information and contribute little to the final feature fusion; therefore, such nodes, like the highest and lowest layers in the second column, are ignored.
[0052] In this embodiment, three feature maps obtained from the Darknet53 feature extraction network are denoted as C3, C4, and C5, and used as inputs to the BiFPN. The goal is to enrich the semantic information of these three feature maps at different scales through a bidirectional feature fusion pathway and lateral connections at the same scale. Please refer to [link to BiFPN documentation]. Figure 4 , Figure 4 This is a schematic diagram of a structural embodiment of the improved feature fusion of the present invention.
[0053] The weights at each level are calculated according to formula (2):
[0054]
[0055] Among them, O, I i Let represent the fused features and the features to be fused, respectively. O is used for the network's subsequent prediction target. ε = 0.0001 is a very small value used to avoid numerical instability that could cause the denominator to equal 0. w i The parameters are learned by the network, and each time w is obtained... i A ReLU operation must be performed afterward to ensure w i ≥0, and the weight values are all between 0 and 1 after normalization.
[0056] S140: Based on the fusion features, the position of the target vehicle is marked on the image to be detected using a bounding box, where the bounding box parameters include the angle dimension.
[0057] The data obtained by multi-scale feature fusion is subsequently processed, including score calculation, mapping back to the original image, and non-maximum suppression; the score processing further includes position regression score, category classification score, and angle classification score.
[0058] In some embodiments, the graphical frame includes a rectangular frame. Based on the fusion features, the position of the target vehicle is marked on the image to be detected using the graphical frame, including: adding an angle dimension to the parameters of the rectangular frame, and using a rectangular frame including horizontal axis parameters, vertical axis parameters, length parameters, width parameters and angle parameters to mark the position of the target vehicle.
[0059] Optionally, before adding the angular dimension to the parameters of the rectangle, the method also includes: based on the predicted value y i The true value σ(x) i The total number of samples n determines the loss and σ(a); where loss and σ(a) are the angle classification losses of the angle dimension.
[0060] In some embodiments, based on fusion features, the location of the target vehicle is marked on the image to be detected using a bounding box, including: when the location of the target vehicle marked by the bounding box is repeated, calculating the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss; and marking the location of the target vehicle on the image to be detected using a rectangular box based on the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss.
[0061] Since vehicles often appear densely parked in remote sensing images, describing their positions using horizontal rectangular boxes leads to overlapping prediction boxes, thus affecting detection performance. Therefore, this invention adds a θ dimension to the rectangular boxes, using rotated bounding boxes (x, y, w, h, θ) to describe the target positions. The angular classification loss after adding the θ dimension is described below.
[0062] Where x and y represent the coordinates of the center point of the rectangle; w and h represent the width and height of the rectangle; and θ represents the angle.
[0063] The calculation of category loss in this invention adopts the BCE Loss of YOLOv5 for binary classification cross-entropy loss, as shown in formula (3), where y i For the predicted value, σ(x) i () represents the actual value:
[0064]
[0065] Where n is the total number of samples, and a is just an example to show how σ is calculated.
[0066] Classification is based on existing definitions. This invention transforms the loss of the θ angle into a classification problem (i.e., angle classification score), effectively avoiding situations outside the defined range. Therefore, the classification loss for the θ angle is calculated using the BCE Loss (binary cross-entropy loss). The weight coefficients of the confidence loss are related to the bounding box loss function. In this invention, the bounding box has an added θ dimension, and the calculation methods for the coordinate and θ loss functions are different. Therefore, the confidence loss should include two aspects: horizontal border + angle. Thus, the weight coefficients of the confidence loss are calculated using SkewIoU, as shown in the calculation method below. Figure 5 As shown, since the overlapping region is a polygon, the area of each triangle is calculated, thus calculating the area S of the overlapping region. o The area S of the merged region u And IoU. Its calculation formulas include (4) to (6), as follows:
[0067]
[0068] S u =w0*h0+w1*h1-S0……(5)
[0069] SkewIoU=S o / S u ……(6)
[0070] This embodiment provides a vehicle target detection method that introduces a multi-channel attention mechanism, global average pooling, and nonlinear activation function processing. This automatically determines the importance of different feature channels, effectively increasing the importance of useful features and suppressing relatively ineffective features, thus helping the network learn and extract more meaningful features of vehicle targets. In the feature fusion stage, by adding upsampling or downsampling processing, vehicle target features from remote sensing images of different resolutions are fused, which can improve the detection accuracy of the model. By introducing an angular dimension, the problem of poor detection results caused by densely parked vehicles in remote sensing images can be effectively solved. In summary, the vehicle target detection method based on deep convolutional networks proposed in this embodiment can quickly and accurately locate targets in remote sensing images with a large field of view.
[0071] The above-mentioned optional solutions, without conflict, can be freely combined by those skilled in the art according to actual needs. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of an embodiment of the improved YOLOv5 of the present invention.
[0072] Optical remote sensing images are characterized by complex and diverse scenes, small pixel proportions of vehicle targets, and significant differences in vehicle scale across images of different resolutions. Furthermore, vehicles are often densely parked, leading to numerous environmental interference factors. Therefore, traditional machine learning methods suffer from poor robustness and performance limitations in remote sensing image processing. Due to the differences between remote sensing images and natural scene images, deep learning methods for natural scenes struggle to achieve optimal detection results. To address these problems and challenges, this invention proposes a vehicle detection technique based on deep convolutional networks, summarized as follows:
[0073] (1) A visual feature construction method is proposed. In view of the difficulty of complex and diverse scenes and small proportion of vehicle target pixels in remote sensing images, this invention embeds a channel attention mechanism in the feature extraction stage. By learning to obtain the importance of each feature channel, the network focuses on the more important features, thereby achieving the effect of suppressing useless information.
[0074] (2) A multi-scale feature fusion method is proposed. A multi-scale, bidirectional, weighted feature fusion pyramid is established, which is connected from top to bottom, from bottom to top, and horizontally. The output results of different convolutional layers in the feature extraction network are fused to make full use of the information of feature layers at different scales and to achieve effective detection of vehicle targets with large scale differences in remote sensing images of different resolutions.
[0075] (3) A proposal is made to transform the angle regression loss problem into a classification problem. To address the difficulties in vehicle target detection in remote sensing images, a rotating rectangle with an angle is used to describe densely parked vehicle targets. By transforming the regression of vehicle target angle information into a classification problem, a rotating box detection effect that better matches the shape of the vehicle is achieved, effectively solving the problem of dense parking and better meeting the actual needs of vehicle target detection in remote sensing images.
[0076] The vehicle target detection device provided by the present invention is described below. The vehicle target detection device described below can be referred to in correspondence with the vehicle target detection method described above.
[0077] Please see Figure 7 , Figure 7 This is a schematic diagram of a vehicle target detection device according to an embodiment of the present invention. In this embodiment, the vehicle target detection device 700 may include: a feature extraction module 710, an enhanced feature module 720, a fused feature module 730, and a target vehicle module 740. Specifically:
[0078] The feature extraction module 710 is used to extract image features from the image to be detected using a multi-channel attention mechanism to obtain a multi-dimensional feature map.
[0079] The enhanced feature module 720 is used to perform global average pooling and non-linear activation function processing on multi-dimensional feature maps to obtain enhanced feature maps; wherein, the enhanced feature maps include feature layers of multiple scales.
[0080] The feature fusion module 730 is used to fuse information from feature layers at multiple scales by adding upsampling or downsampling processing to obtain fused features.
[0081] The target vehicle module 740 is used to mark the position of the target vehicle on the image to be detected using a bounding box based on fused features. The bounding box parameters include angular dimensions.
[0082] In some embodiments, the enhanced feature module 720 is used for:
[0083] Global average pooling is performed on the multi-dimensional feature map to obtain pooled data; the pooled data is then dimensionality-reduced by performing FC layer dimensionality increase under ReLU activation, and finally the Sigmoid activation function is used to obtain the weights of each channel; based on the multi-dimensional feature map and the weights of each channel, an enhanced feature map is obtained.
[0084] In some embodiments, the feature fusion module 730 is used for:
[0085] The first and second parameters are obtained by convolution and downsampling of feature layers at multiple scales. The first and second parameters are then input into a weighted bidirectional feature pyramid network to obtain fused features. The weighted bidirectional feature pyramid network is a bidirectional feature fusion channel that is both top-down and bottom-up, and there are lateral connection paths between feature layers at the same scale.
[0086] In some embodiments, the graphic frame includes a rectangle, and the target vehicle module 740 is used for:
[0087] Add an angle dimension to the parameters of the rectangle, and use a rectangle with horizontal axis parameters, vertical axis parameters, length parameters, width parameters, and angle parameters to mark the position of the target vehicle.
[0088] Optionally, the target vehicle module 740 is also used to: based on the predicted value y i The true value σ(x) i Let n, a, and σ(a) determine the loss and σ(a); where loss and σ(a) are the angle classification losses of the angle dimension.
[0089] The formulas for calculating loss and σ(a) are as follows:
[0090]
[0091] In some embodiments, the target vehicle module 740 is used for:
[0092] When the locations of target vehicles marked by bounding boxes are repeated, the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss are calculated. Based on the area of the overlapping region, the area of the merged region, and the weight coefficient of the confidence loss, the locations of target vehicles are marked on the image to be detected using bounding boxes.
[0093] This embodiment provides a vehicle target detection device. By introducing a multi-channel attention mechanism, global average pooling, and nonlinear activation function processing, it can automatically determine the importance of different feature channels, effectively increasing the importance of useful features and suppressing relatively ineffective features, thus helping the network learn and extract more meaningful features of vehicle targets. In the feature fusion stage, by adding upsampling or downsampling processing, vehicle target features from remote sensing images of different resolutions are fused, which can improve the detection accuracy of the model. By introducing an angular dimension, the problem of poor detection results caused by densely parked vehicles in remote sensing images can be effectively solved. In summary, this embodiment can quickly and accurately locate targets in remote sensing images with a large field of view.
[0094] The present invention also provides an electronic device, please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of an embodiment of the electronic device of the present invention. In this embodiment, the electronic device 800 may include a memory 810, a processor 820, and a computer program stored in the memory 820 and executable on the processor 810. When the processor 810 executes the program, it implements the vehicle target detection methods provided by the above-described methods.
[0095] Optionally, the electronic device 800 may further include a communication bus 830 and a communication interface 840, wherein the processor 810, the communication interface 840, and the memory 820 communicate with each other through the communication bus 830. The processor 810 can call logical instructions in the memory 820 to execute a vehicle target detection method, which includes: extracting image features from the image to be detected using a multi-channel attention mechanism to obtain a multi-dimensional feature map; performing global average pooling and non-linear activation function processing on the multi-dimensional feature map to obtain an enhanced feature map; wherein the enhanced feature map includes feature layers of multiple scales; fusing information from the feature layers of multiple scales by adding upsampling or downsampling processing to obtain fused features; and marking the position of the target vehicle on the image to be detected using a bounding box based on the fused features, wherein the bounding box parameters include angular dimensions.
[0096] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the vehicle target detection method provided by the above methods. The steps and principles of the method have been described in detail in the above methods and will not be repeated here.
[0098] The vehicle target detection method, device, electronic device, and storage medium provided by this invention, by introducing a multi-channel attention mechanism, global average pooling processing, and nonlinear activation function processing, can automatically determine the importance of different feature channels, effectively increasing the importance of useful features and suppressing relatively ineffective features, thus helping the network learn and extract more meaningful features of vehicle targets. In the feature fusion stage, by adding upsampling or downsampling processing, vehicle target features from remote sensing images of different resolutions are fused, which can improve the detection accuracy of the model. By introducing an angular dimension, the problem of poor detection results caused by densely parked vehicle targets in remote sensing images can be effectively solved. In summary, the vehicle target detection method based on deep convolutional networks proposed in this invention can quickly and accurately locate targets in remote sensing images with a large field of view.
[0099] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle target detection method, characterized in that, The vehicle target detection method based on a YOLOv5 network with an added SE module includes: A multi-channel attention mechanism is used to extract image features from the image to be detected, resulting in a multi-dimensional feature map. The multi-dimensional feature map is subjected to global average pooling and non-linear activation function processing to obtain an enhanced feature map; wherein the enhanced feature map includes feature layers of multiple scales; By adding upsampling or downsampling processing, information is fused from the feature layers at multiple scales to obtain fused features; Based on the fusion features, the position of the target vehicle is marked on the image to be detected using a bounding box, wherein the bounding box parameters include angle dimensions; The process of fusing information from the feature layers at multiple scales by adding upsampling or downsampling processing to obtain fused features includes: The first and second parameters are obtained by convolution and downsampling of feature layers at multiple scales. The first parameter and the second parameter are input into a weighted bidirectional feature pyramid network to obtain the fused features; The weighted bidirectional feature pyramid network is a bidirectional feature fusion channel that is both top-down and bottom-up, and there are lateral connection paths between feature layers of the same scale.
2. The vehicle target detection method according to claim 1, characterized in that, The process of performing global average pooling and non-linear activation function processing on the feature map to obtain the enhanced feature map includes: Global average pooling is performed on the multi-dimensional feature map to obtain pooled data; The pooled data is dimensionality reduced, then dimensionality is increased by an FC layer under the activation of the ReLU function, and finally the weights of each channel are obtained by using the Sigmoid activation function. The enhanced feature map is obtained based on the multi-dimensional feature map and the weights of each channel.
3. The vehicle target detection method according to claim 1, characterized in that, The bounding box includes a rectangle. Marking the position of the target vehicle on the image to be detected using the bounding box based on the fused features includes: Add an angle dimension to the parameters of the rectangle, and use a rectangle that includes horizontal axis parameters, vertical axis parameters, length parameters, width parameters, and angle parameters to mark the position of the target vehicle.
4. The vehicle target detection method according to claim 3, characterized in that, Before adding the angle dimension to the parameters of the rectangle, it also includes: Based on the predicted value True value Total sample size Sure and ; in, and It is the angle classification loss of the angle dimension.
5. The vehicle target detection method according to claim 4, characterized in that, and The calculation formula is: 。 6. The vehicle target detection method according to claim 4, characterized in that, The step of marking the location of the target vehicle on the image to be detected using a bounding box based on the fused features includes: When the locations of the target vehicles marked by the graphic frame are repeated, the area of the overlapping area, the area of the merged area, and the weighting coefficient of the confidence loss are calculated. Based on the area of the overlapping region, the area of the merged region, and the weighting coefficient of the confidence loss, the position of the target vehicle is marked on the image to be detected using a rectangular bounding box.
7. A vehicle target detection device, characterized in that, The vehicle target detection device, based on a YOLOv5 network with an added SE module, includes: The feature extraction module is used to extract image features from the image to be detected using a multi-channel attention mechanism to obtain a multi-dimensional feature map. The feature enhancement module is used to perform global average pooling and non-linear activation function processing on the multi-dimensional feature map to obtain an enhanced feature map; wherein the enhanced feature map includes feature layers of multiple scales; The feature fusion module is used to fuse information from the feature layers at multiple scales by adding upsampling or downsampling processing to obtain fused features; The target vehicle module is used to mark the position of the target vehicle on the image to be detected using a graphical frame based on the fused features, wherein the parameters of the graphical frame include angle dimensions; The fusion feature module is specifically used to: perform convolution and downsampling on feature layers of multiple scales to obtain first and second parameters; input the first and second parameters into a weighted bidirectional feature pyramid network to obtain the fusion features; wherein, the weighted bidirectional feature pyramid network is a bidirectional feature fusion channel from top to bottom and from bottom to top, and there are lateral connection paths between feature layers of the same scale.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the vehicle target detection method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the vehicle target detection method as described in any one of claims 1 to 6.