Road target detection method and system based on CSAFM attention mechanism
By introducing the CSAFM attention mechanism and improving the feature extraction network, the problem of insufficient accuracy of existing target detection algorithms in complex environments is solved, achieving higher detection accuracy and speed, and improving the performance of target tracking.
Patent Information
- Application Number
- CN202310296821.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-03-24
AI Technical Summary
Existing target detection algorithms still have room for improvement in detection accuracy, especially in their ability to identify targets in complex environments.
The CSAFM attention mechanism is introduced, which improves the feature extraction network by combining grouped convolution, channel attention module and spatial attention module, enhances attention to target information and location information, and improves feature extraction capability.
It improves the accuracy and speed of target detection, especially the ability to identify targets in complex environments, while also enhancing the accuracy of target tracking.
Smart Images

Figure CN116246148B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image detection, and more particularly to a road target detection method and system based on a CSAFM attention mechanism. BACKGROUND
[0002] Target detection is one of the core problems in the field of computer vision, and its task is to find all the targets of interest in the image and determine their categories and positions. Due to different appearances, postures, and different degrees of occlusion of various objects, plus the interference of factors such as light during imaging, target detection has always been a challenging problem. With the advent of convolutional neural networks, target detection based on deep learning has gradually become the mainstream of target detection algorithms. Target detection algorithms based on deep learning mainly include two categories: (1) two-stage target detection algorithms; (2) one-stage target detection algorithms. Among them, the two-stage target detection algorithm focuses on more accurate accuracy by sacrificing detection speed, and the one-stage target detection algorithm obtains real-time detection speed by sacrificing certain accuracy. It can be said that the two methods have their own advantages and disadvantages, and different algorithms are usually selected according to different application scenarios and requirements.
[0003] The effect of target detection depends on the feature extraction network of the convolutional neural network, and the ability of feature extraction determines whether the extracted features can bring better improvement to detection, so most convolutional neural networks improve the feature extraction ability of the network by increasing the length, width and base of the network, and the attention mechanism helps the feature extraction network to pay more attention to the key features and where the features are, so as to help the network pay more attention to the target. The existing attention mechanisms include SENet, CBAM and the like, wherein the innovation of the SENet network lies in paying attention to the relationship between channels, so as to obtain a model that can automatically learn the importance of different channel features, for this purpose, the SENet proposes a Squeeze-and-Exciation (SE) module; the CABM combines the channel and spatial attention mechanism modules, wherein the channel attention module mainly pays attention to the meaningful information in the input picture, the feature map is changed from HxWxC to 1x1xC size by passing through two parallel MaxPool layers and AvgPool layers, then compressed and recovered by Share MLP, activated by a ReLU function to obtain two results. After element-wise addition of the two results, the original picture is multiplied by the sigmoid function to obtain the final result of HxWxC, the spatial attention module mainly pays attention to the position information in the input picture, and the results of the channel attention are averaged and maximized to obtain two HxWx1 feature maps. The two feature maps are spliced by the concat operation, and then changed to a 1-channel feature map by a 7x7 convolution. Finally, the original picture is multiplied by the sigmoid function to obtain the final result of HxWxC.
[0004] However, the detection accuracy of the existing attention mechanism introduced into the target detection algorithm still needs to be improved. Therefore, how to further improve the detection accuracy of the target detection algorithm is a problem that needs to be solved by those skilled in the art. SUMMARY
[0005] Therefore, in order to further improve the target detection accuracy, the present application provides a road target detection method and system based on a CSAFM (Channel and Spatial Attention Fusion Module) attention mechanism.
[0006] In order to achieve the above purpose, the present application provides the following technical solutions:
[0007] A road target detection method based on a CSAFM attention mechanism, comprising the following steps:
[0008] Step 1: introducing the CSAFM attention mechanism into the feature extraction network of the target detection algorithm;
[0009] Step 2, training the target detection algorithm introducing the CSAFM attention mechanism using the road image dataset to obtain a road image target detection model;
[0010] Step 3, inputting the to-be-recognized road image into the road image target detection model to obtain a target detection result of the to-be-recognized road image.
[0011] Preferably, in the step 1, the CSAFM attention mechanism comprises:
[0012] Group convolution: dividing global features X in the feature map F into G groups along the channel dimension to obtain G sub-feature maps;
[0013] Channel attention module: using average pooling and maximum pooling operations to aggregate global features X to generate two different tensors: and Then forwarded to the shared network MLP to generate channel M C ; applying average pooling and maximum pooling operations to two branches X k1 , X k2 of each sub-feature map to generate local vectors x of the sub-feature map; merging the output feature vectors by element-wise operation on the sub-feature map to obtain the final channel attention x C through an activation function.
[0014] Spatial attention module: applying GroupNorm on two branches of each sub-feature map to obtain spatial direction feature information to calculate spatial attention x S ; connecting two branches of each sub-feature map.
[0015] Aggregation and reorganization: aggregating all sub-feature maps by concat and reorganizing using channel shuffle operation.
[0016] Preferably, in the channel attention module, the channel M C is:
[0017] M C (X)=MLP(AvgPool(X))+MLP(MaxPool(X))。
[0018] Preferably, in the channel attention module, the local vector x is:
[0019] x=AvgPool(X k1 +X k2 )+MaxPool(X k1 +X k2 )+M c (X)。
[0020] In the channel attention module, the channel attention x C is:
[0021] x C = sigma(W C x + b C ) * X k1 ;
[0022] wherein sigma represents a sigmoid activation function, W C and b C are used to scale and adjust the size of x.
[0023] In the spatial attention module, the spatial attention x S is:
[0024] x S = sigma(W S * (GN(X k2 ) + GM(X k1 )) + b S ) * X k2 ;
[0025] wherein sigma represents a sigmoid activation function, W S and b S are used to scale and adjust the size of GN(X k2 ) + GN(X k1 ), and the values are
[0026] In step 1, the target detection algorithm is preferably a single-stage target detection algorithm or a two-stage target detection algorithm.
[0027] In step 2, the road image dataset (wherein the road targets include vehicles, pedestrians, etc.) is preferably an open dataset MOT16.
[0028] The application also discloses a road target detection system based on the CSAFM attention mechanism, comprising:
[0029] a network structure improvement module for introducing the CSAFM attention mechanism into a feature extraction network of a target detection algorithm;
[0030] a network training module for training the target detection algorithm to which the CSAFM attention mechanism is introduced using a road image dataset, to obtain a road image target detection model;
[0031] a target detection module for inputting a to-be-identified road image into the road image target detection model to obtain a target detection result of the to-be-identified road image.
[0032] Preferably, the CSAFM attention mechanism comprises:
[0033] Group convolution: used to divide the global feature X in the feature map F into G groups along the channel dimension, to obtain G sub-feature maps;
[0034] Channel attention module: used to aggregate the global feature X using average pooling and max pooling operations to generate two different tensors: and Then forwarded to the shared network MLP to generate channel M C ; the average pooling and max pooling operations are applied to two branches X k1 , X k2 on each sub-feature map to generate local vectors x of the sub-feature map; the output feature vectors are merged by element-wise operation on the sub-feature map, and the final channel attention x C is obtained through the activation function.
[0035] Spatial attention module: used to apply GroupNorm on two branches of each sub-feature map to obtain spatial direction feature information to calculate spatial attention x S ; the two branches of each sub-feature map are connected.
[0036] Aggregation and reorganization: used to aggregate all sub-feature maps using concat and reorganize by channel shuffle operation.
[0037] Via the technical solution described above, the present application provides a road target detection method and system based on the CSAFM attention mechanism, which has the following beneficial effects compared with the prior art:
[0038] The present application helps the convolutional network to focus on target information and position information from the channel level and the spatial level respectively, improves the fusion method of channel attention and spatial attention, increases the information transmission of the two kinds of attention features, improves the information extraction effect and feature expression ability of the feature extraction network, and further improves the target detection precision, while taking into account the high target detection speed.
[0039] And the present application can also be combined with target tracking to further improve the accuracy of target tracking. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0041] Figure 1 This is a schematic diagram of the method steps of the present invention;
[0042] Figure 2 This is a schematic diagram of the system modules of the present invention;
[0043] Figure 3 Here is a diagram of the Faster R-CNN architecture;
[0044] Figure 4 The diagram shows the CSAFM-ResNet50 structure obtained by combining ResNet50 with the CSAFM attention mechanism of this invention.
[0045] Figure 5 This is a schematic diagram of the experimental training process in Example 3;
[0046] Figure 6 This is a comparison image of the baseline and CSAFM-ResNet50 feature map converted to grayscale in Example 3;
[0047] Figure 7 Here is a flowchart of the DBT detection and tracking process;
[0048] Figure 8 Flowchart for project tracking and detection;
[0049] Figure 9 This is a schematic diagram of the tracker training results for the unimproved detector in Example 4;
[0050] Figure 10 This is a schematic diagram of the tracker training results of the improved detector in Example 4;
[0051] Figure 11 This is a schematic diagram of the MOT Challenge evaluation index in Example 4;
[0052] Figure 12 This is a comparison chart of the results of the improved detection and tracking method and the unimproved detection and tracking method in Example 4;
[0053] Figure 13 This is a schematic diagram of the channel attention structure of the CSAFM attention mechanism of the present invention;
[0054] Figure 14 This is a schematic diagram of the spatial attention structure of the CSAFM attention mechanism of the present invention;
[0055] Figure 15 This is an example diagram of the road image dataset in Embodiment 4 of the present invention. Detailed Implementation
[0056] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort are within the protection scope of the present application.
[0057] The embodiments of the present application disclose a road target detection method based on a CSAFM attention mechanism, referring to Figure 1 , comprising the following steps:
[0058] Step 1: introducing the CSAFM attention mechanism into the feature extraction network of the target detection algorithm.
[0059] The structural diagram of the CSAFM attention mechanism is shown in Figure 13 and Figure 14 , and a middle feature map F ∈ [C, H, W] is given as input, where C, H and W represent the channel, spatial height and width, respectively. In order to divide each sub-feature X k into two branches along the channel dimension, the CSAFM attention mechanism first extracts global features X from the feature map F, and divides X into G (G = 64) groups along the channel dimension, which is defined as X = [X1, X2, …, X G , specifically,
[0060] Then, the attention module is used to calculate the correlation significance coefficient of each sub-feature. The detailed information of each attention module is introduced as follows:
[0061] Channel attention module: first, the global information of the feature map is aggregated by using the average pooling and maximum pooling operations to generate two different tensors: and Then, they are forwarded to the shared network (MLP) to generate the channel The calculation formula is as follows:
[0062] M C (X) = MLP(AvgPool(X)) + MLP(MaxPool(X));
[0063] After that, the average pooling and maximum pooling operations are applied to the two branches of each sub-feature X k to generate the local vector of the sub-feature The calculation formula is as follows:
[0064] x = AvgPool(X k1 + X k2 ) + MaxPool(X k1 + Xk2 )+M c (X);
[0065] Then, the output feature vector is merged by element-wise operation on the sub-features, and finally the final channel attention is obtained through a simple sigmoid activation function The formula is as follows:
[0066] x C =σ(W C x+b C )·X k1 ;
[0067] Wherein, σ represents a sigmoid activation function, and is used to scale and adjust the size of x.
[0068] Spatial attention module: GroupNorm (GN) is applied on two branches of each sub-feature map to obtain spatial direction feature information to calculate spatial attention x S ; Connect the two branches of each sub-feature map; The spatial attention x S is:
[0069] x S =σ(W S ·(GN(X k2 )·+GN(X k1 ))+b S )·X k2 ;
[0070] Wherein, σ represents a sigmoid activation function, W S and b S represent the size of GN(X k2 )+GN(X k1 ) for scaling and adjusting, and the value is
[0071] Finally, aggregation and reorganization: all sub-feature maps are aggregated by concat, and reorganized by channel shuffle operation to allow cross-group information to flow along the channel dimension. The size of the final output of the CSAFM attention mechanism is the same as the global feature X.
[0072] The target detection algorithm can be a single-stage target detection algorithm or a two-stage target detection algorithm.
[0073] Taking the two-stage target detection algorithm Faster RCNN as an example, it is fused with the CSAFM attention mechanism. The specific structure of the Faster RCNN network is as follows: Figure 3As shown. For the Faster RCNN algorithm, the application adopts ResNet50 as its feature extraction network, adds the CSAFM attention mechanism to the first layer and the last two layers of the feature extraction network, as shown in Figure 4 The extracted feature information is enhanced from the feature channel and spatial level, while the increase of additional parameters is reduced, the feature extraction speed is accelerated, and the feature expression ability of the feature extraction network for small targets and targets in various situations is improved.
[0074] Taking the single-stage target detection algorithm YOLOv5 as an example, the CSAFM attention mechanism is fused. The YOLOv5 algorithm uses CSPNet as the feature extraction network, so the CSAFM attention mechanism designed by the application is combined with the feature network to enhance the feature extraction ability of the feature extraction network of the YOLOv5 algorithm. In this embodiment, the CSAFM attention mechanism is fixedly added to the Head position, which can have good feature extraction ability.
[0075] Step 2, using a road image dataset to train the target detection algorithm with the introduced CSAFM attention mechanism, obtaining a road image target detection model;
[0076] Step 3, inputting the to-be-identified road image into the road image target detection model to obtain a target detection result of the to-be-identified road image.
[0077] Embodiment 2
[0078] This embodiment provides a road target detection system based on the CSAFM attention mechanism, referring to Figure 2 , comprising:
[0079] The network structure improvement module is used for introducing the CSAFM attention mechanism into the feature extraction network of the target detection algorithm.
[0080] The network training module is used for training the target detection algorithm with the introduced CSAFM attention mechanism using a road image dataset, obtaining a road image target detection model.
[0081] The target detection module is used for inputting the to-be-identified road image into the road image target detection model to obtain a target detection result of the to-be-identified road image.
[0082] For the system modules disclosed in the embodiment, since they correspond to the method disclosed in the embodiment, the description is relatively simple, and the relevant part is described in the method part.
[0083] Embodiment 3
[0084] This embodiment verifies the beneficial effects of the method of the application by performing target detection on the feature map through specific experiments.
[0085] Experimental platform: The experiment in this embodiment is carried out on a Linux operating system, Visual Studio Code is selected as an integrated development environment, and a model framework is realized based on a Python language. The main hardware configuration of the experiment is: Ubuntu 20.0464-bit operating system, the processor (CPU) is Intel Core i9-10900K, 5000MHz, the graphics card (GPU) is GeForce RTX3090 (24G), and the memory (RAM) is 32G. The deep learning development environment is: Visual Studio Code, python3.8.12, CUDA11.2, cuDNN8.0.2, PyTorch1.11.0, and Tensorflow_gpu-2.4.0.
[0086] Dataset: The open datasets PASCAL VOC2007 and MS COCO are selected as the data sets, the algorithm is trained and tested on the two data sets respectively, and the Backbone of the Faster RCNN network is tested by using multiple feature extraction networks such as VGG16 and ResNet series.
[0087] Experimental setup: Due to the large amount of data, the method of starting from zero to retrain is time-consuming and the model converges slowly, which affects the detection effect. Therefore, based on transfer learning, the Faster RCNN is used to initialize the model parameters of the training model, and the VOC data set and the COCO data set are fine-tuned and trained, and the experimental training process is as shown in Figure 5 In the experiment, some parameters are preset in advance, a total of 100 epochs are trained, the batch size is 4 in the first 50 epochs, the initial learning rate is set to 0.0001, the weight decay is 0.0005, and the learning rate decay multiplier is 0.96. In the last 50 epochs, the batch size is 2, the initial learning rate is reset to 0.00001, and the rest of the parameters remain unchanged. The specific parameter settings are shown in Table 1.
[0088] Table 1 Experimental parameter settings
[0089]
[0090] Experimental results: This experiment compares the Faster RCNN detector when the Backbone is ResNet50, by adding different attention models, including SENet, CBAM, Non-Local and other attention models combined with ResNet50 feature extraction network to achieve the effect, and compares the CSAFM-ResNet50 feature extraction network proposed in the application, it is found that the application scheme improves the detection accuracy while adding fewer additional parameters, see Table 2 for details.
[0091] Table 2 Comparison of various attention models with baseline
[0092]
[0093] At the same time, in order to test the feature extraction effect of CSAFM-ResNet50, the present embodiment is compared with the baseline of ResNet50. By visualizing and converting each layer feature map into a gray scale image, the clarity of the feature information extracted by the two feature extraction networks is observed to determine whether the two feature extraction networks are effective. The gray scale image effect is as shown in Figure 6 .
[0094] From the above comparison chart, it can be found that as the feature map deepens, the feature extraction effect of the ResNet50 baseline has obviously weakened, and a certain fuzziness has been produced for the outline and details of the target, which cannot accurately capture the target features. Compared with the baseline, the CSAFM-ResNet50 feature extraction network improves the feature extraction capability to a certain extent. As can be seen from the figure, when the feature map is deep, the feature map extracted by the CSAFM-ResNet50 feature extraction network is more detailed and relatively complete than the baseline feature. At the same time, the present embodiment compares multiple Backbone in the Faster RCNN detector, such as VGG16, ResNet series, etc. and YOLOv5 algorithm and YOLOv5+CSAFM are compared, and the experimental results are shown in Table 3.
[0095] Table 3 Comparison of various algorithms
[0096]
[0097]
[0098] Example 4
[0099] The target detection method is applied to a road video in this embodiment, that is, the target detection is combined with target tracking. A multi-target tracking algorithm based on detection-based tracking (DBT) is mainly used in this embodiment, and a flowchart thereof is as shown in Figure 7 Multi-target tracking is prone to target loss due to a large number of tracking IDs and frequent occlusion. The DeepSORT algorithm used in this embodiment is a multi-target tracking algorithm based on deep learning. The algorithm mainly improves the target detection algorithm and combines a DeepSORT tracker to achieve a high-performance real-time multi-target tracking model. In order to enable the combined tracking algorithm to achieve real-time detection and tracking, the detector YOLOv5 is combined with the tracker DeepSORT in this embodiment to implement a target tracking algorithm based on deep learning. The detection and tracking project roughly flows as shown in Figure 8
[0100] For an input video sequence, an rtsp, rtmp, mp4 or other video format can be used as the input of the detector. The input can be a real-time video or a downloaded video. In the detector, the YOLOv5-4.0 version is used as the code of the YOLOv5 in this embodiment for training. This is because a commonly used two-stage detector first needs to generate a candidate region generator and extract features from each candidate region, and then use a region classifier to predict the category of the candidate region. YOLO is a single-stage detector that does not need to generate a candidate region, but directly classifies and predicts the object at each position of the feature map, which is more efficient. Meanwhile, the improved CSAFM attention mechanism is added to YOLOv5. The training weight is obtained by training the training set, and the weight is used for target detection. For each input frame, the target object is identified, the classification and coordinates are given, and the information is transmitted to the tracker. The DeepSORT algorithm is used in the tracker stage. One or more feature extraction algorithms are used to extract the apparent features, motion or interaction features, and a trajectory predictor can also be used to predict the next position of the target. Then, the similarity between the apparent features and the motion features of two targets is calculated. The similarity is used as the basis to associate the detection objects and the trajectories belonging to the same target, and the detection objects are assigned the same ID as the trajectories. The estimated state system and the estimated variance or uncertainty of the Kalman filter-based tracking are used for prediction.
[0101] The specific experimental process is as follows:
[0102] Experimental platform: This embodiment is carried out on a Linux operating system, Visual Studio Code is selected as an integrated development environment, and a model framework is realized based on a Python language. The main hardware configuration of the experiment is: Ubuntu 20.0464-bit operating system, the processor (CPU) is Intel Core i9-10900K, 5000MHz, the graphics card (GPU) model is GeForce RTX3090 (24G), and the memory (RAM) is 32G. The deep learning development environment is: Visual Studio Code, python3.8.12, CUDA11.2, cuDNN8.0.2, PyTorch1.11.0, and Tensorflow_gpu-2.4.0.
[0103] Dataset: The road image dataset used for target detection and target tracking in this embodiment is the open dataset MOT16. The MOT16 dataset is a dataset for measuring the standard of multi-target tracking method. The target types in the dataset include pedestrians, vehicles, bicycles and other different types, which have high diversity. The dataset contains video sequences in multiple real scenes, and most of the dataset is taken from various streets and roads, which belongs to the data set of urban road type, which meets the requirements of the experimental data set. Each video sequence in the dataset contains different number of targets, from a few to hundreds, covering different density target areas, both sparse scenes and dense scenes, which is suitable as a dataset for judging detection and tracking performance, such as Figure 15 , there are street road images, traffic road images, and comprehensive road images.
[0104] Experimental setup: In this experiment, YOLOv5 is used as the detector, and DeepSORT is used as the tracker. Therefore, after training the detection file, the tracker needs to be trained. In this embodiment, the DeepSORT tracker is trained for YOLOv5 without improvement and YOLOv5 with CSAFM attention mechanism respectively. The training results of the tracker of the unimproved detector are shown in Figure 9 , and the training results of the tracker of the improved detector are shown in Figure 10 It can be seen that the training results of the tracker are generally good in the early epochs, and the results are saved, among which the result of the tracker of the unimproved detector reaches the best result at epoch 11, and the accuracy reaches 77.31%, and the result of the tracker of the improved detector reaches the best result at epoch 7, and the accuracy reaches 79.86%. Among them, for training, this embodiment iteratively trains 40 epochs.
[0105] Experimental Results: The evaluation of multi-target tracking is mainly based on the metrics of the MOT Challenge, some of which are as follows: Figure 11 As shown in the diagram. Here, MOTA represents tracking accuracy, considering N, FP, and ID switch issues. Its formula is a weighted average of all frames, primarily used to measure performance in object detection and trajectory preservation. MOTP represents tracking precision, used to measure localization accuracy (mainly the detector, not the tracker). Rcll is recall, the ratio of correctly matched detected targets to the number of targets given by the ground truth. MT is the proportion of tracks that match the ground truth at least 80% of the time among all tracked targets. ML is the proportion of tracks that match the ground truth only less than 20% of the time among all tracked targets. IDF1 represents the ratio of correctly identified detections to the average true number and the number of computed detections. IDP represents the score of correctly identified computed detections. IDR represents the score of correctly identified ground truth detections. IDs represent the number of times the ID assigned to the ground truth changed. PT represents the percentage of tracks partially tracked by the target. GT represents the ground truth. FP represents the total number of false alarms. FN represents the total number of missed targets. FM represents the number of times computed tracking was interrupted. Based on the above evaluation metrics, the results of the tracker with the unimproved detector (YOLOv5+DeepSORT, YD) and the tracker with the improved detector (YOLOv5+CSAFM+DeepSORT, YCD) calculated in this embodiment are shown in Table 4.
[0106] Table 4 Comparison of MOT16 Algorithm Results (a) MOT16-02 Test Results
[0107]
[0108] (b) MOT16-04 test results
[0109]
[0110] (c) MOT-09 test results
[0111]
[0112] (d) MOT-10 test results
[0113]
[0114] (e) MOT-11 test results
[0115]
[0116] (f) MOT16 summary evaluation
[0117]
[0118] From the summary evaluation table above, it can be seen that the improved method MOTA and MOTAL are 0.9% higher than the unimproved method, while MOTP is 1% less, and the IDs are also higher. By comparing the detection and tracking results of the video, it is found that this is caused by problems such as occlusion, target blur, small target, etc., and the method proposed in the present application can detect these targets to a certain extent, as shown in FIG. 6, wherein the left side is the improved detection and tracking method, and the right side is the unimproved detection and tracking method. Figure 12
[0119] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be mutually referred to.
[0120] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A road target detection method based on CSAFM attention mechanism, characterized in that, Includes the following steps: Step 1: Introduce the CSAFM attention mechanism into the feature extraction network of the object detection algorithm; Step 2: Train the target detection algorithm with CSAFM attention mechanism using a road image dataset to obtain a road image target detection model; Step 3: Input the road image to be identified into the road image target detection model to obtain the target detection result of the road image to be identified; In step 1, the CSAFM attention mechanism includes: Grouped convolution: The global feature X in the feature map F is divided into G groups along the channel dimension, resulting in G sub-feature maps; Channel attention module: Aggregates global features X using average pooling and max pooling operations, generating two distinct tensors: and Then forwarded to the shared network MLP to generate a channel. Average pooling and max pooling operations are applied to both branches of each sub-feature map. Above, to generate local vectors of sub-feature maps. The feature vector is merged by performing element-wise operations on the sub-feature maps, and the final channel attention is obtained through an activation function. ; Spatial Attention Module: GroupNorm is applied to both branches of each sub-feature map to obtain spatial orientation feature information for calculating spatial attention. Connect the two branches of each sub-feature map; Aggregation and recombination: Aggregate all sub-feature maps using concat, and recombine them using channel shuffle operation; In the channel attention module, the channel for: ; In the spatial attention module, spatial attention for: ; in, This represents the sigmoid activation function. and Indicates the use of scaling and adjustment The size, value .
2. The road target detection method based on CSAFM attention mechanism according to claim 1, characterized in that, In the channel attention module, local vectors for: 。 3. The road target detection method based on CSAFM attention mechanism according to claim 1, characterized in that, In the channel attention module, channel attention for: ; in, This represents the sigmoid activation function. and It is used to scale and adjust the size of x.
4. The road target detection method based on CSAFM attention mechanism according to claim 1, characterized in that, In step 1, the target detection algorithm is either a single-stage target detection algorithm or a two-stage target detection algorithm.
5. A road target detection method based on CSAFM attention mechanism according to claim 1, characterized in that, In step 2, the road image dataset is the open dataset MOT16.
6. A road target detection system based on the CSAFM attention mechanism, characterized in that, The road target detection system employs the road target detection method based on the CSAFM attention mechanism according to any one of claims 1 to 5, wherein the road target detection system comprises: A network structure improvement module is used to introduce the CSAFM attention mechanism into the feature extraction network of the object detection algorithm; The network training module is used to train the target detection algorithm with the CSAFM attention mechanism using a road image dataset to obtain a road image target detection model. The target detection module is used to input the road image to be identified into the road image target detection model to obtain the target detection result of the road image to be identified.
Citation Information
Patent Citations
Person re-identification method combining reverse attention and multi-scale deep supervision
US20210232813A1
Method for re-recognizing object image based on multi-feature information capture and correlation analysis
US20220415027A1