Low-altitude UAV target detection algorithm based on improved SSD
By introducing channel attention modules and Transformer's characteristic fusion module in the SSD algorithm, the problem of low accuracy and robustness in low -altitude drone detection technology has been solved, and a more efficient small target detection ability is achieved.
Patent Information
- Application Number
- CN202411295662.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-18
AI Technical Summary
The existing low-altitude drone detection technology has problems such as low accuracy, poor robustness and high computational complexity, especially in complex scenarios, small target detection results are not good.
By introducing a channel attention module and a Transformer-based feature fusion module into the SSD target detection algorithm, the semantic information of high-level feature maps is enhanced, and feature maps of different scales are fused to solve the problem of feature information loss.
It improves the accuracy and robustness of low-altitude UAV target detection, especially the small target detection capability in complex scenes, and enhances the semantic understanding of the target.
Smart Images

Figure CN118823614B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of target detection technology, and specifically to a low-altitude UAV target detection algorithm based on improved SSD. Background Art
[0002] Low-altitude drones are drones that have some or all of the characteristics of "low flying altitude, slow flying speed, and small reflection area". Compared with traditional drones, low-altitude drones have better concealment, flexibility, and maneuverability, and show a trend of intelligent, modular, and clustered development. However, the indiscriminate and illegal flights of low-altitude drones have brought new threats and challenges to target protection at this stage. As an important part of drone countermeasures and control, the effective detection of low-altitude drones has become an issue that needs to be solved urgently.
[0003] At present, commonly used low-altitude drone detection technologies include acoustic detection, radio detection, and radar detection, but these technologies often require expensive equipment and specific environments. Machine vision-based methods can obtain evidence through video, are low-cost and easy to use. In recent years, the application of deep learning in target detection has become a hot topic in academia, especially in the detection speed and accuracy of small targets, and has been gradually applied to drone detection tasks. Detection algorithms based on convolutional neural networks can be divided into two categories: two-stage target detection algorithms and single-stage target detection algorithms.
[0004] Two-stage target detection algorithms are mostly region-based methods, which divide the detection problem into two stages: generating candidate regions containing the approximate location information of the target and classifying and refining the location of the candidate regions. Two-stage target detection algorithms have high accuracy and can handle complex situations, but they have high computational complexity and relatively slow inference speed. Typical representatives of two-stage target detection algorithms are RCNN, Fast-RCNN, and Faster-RCNN. Among them, the RCNN algorithm first generates a series of candidate regions through a selective search algorithm, then extracts features from these target regions, and trains SVM to classify these features while performing bounding box regression. This method has improved detection accuracy compared to traditional algorithms, but the disadvantage is that the region proposal algorithm generates a large number of candidate regions, which requires a lot of calculations to process, and the training is divided into multiple steps, which is time-consuming, slow, and has poor real-time performance. The Fast-RCNN algorithm uses ROI Pooling to pool the corresponding regions in the feature map into a fixed-size feature map, which is convenient for subsequent classification and output regression operations and speeds up processing. Faster-RCNN uses a region proposal network to replace selective search, which greatly improves the speed of generating detection boxes. In the above algorithm, R-CNN is structurally improved to build a fast detector, but the detection accuracy is greatly reduced.
[0005] The single-stage target detection algorithm is a regression-based algorithm that does not generate candidate regions and can directly obtain the target detection results from the image. The algorithm has fast inference speed and simple calculation, but the accuracy is relatively low and it is easily affected by background interference. Typical representatives of single-stage target detection algorithms are SSD and YOLO algorithms. Among them, the YOLO algorithm is a CNN that simultaneously predicts the positions and categories of multiple detection boxes, realizes end-to-end object detection, greatly improves the detection speed, but has poor generalization ability when facing objects with large scale changes. Compared with the YOLO algorithm, the SSD algorithm sets a priori boxes with different scales or aspect ratios and uses convolution for detection. The detection accuracy is improved while ensuring the detection speed. Therefore, many scholars choose the SSD algorithm and its improvements to complete the detection task of low-altitude UAV targets: Chen et al. used the SSD algorithm to fuse multi-source information from radar and RGB cameras to detect invading UAVs, but could only identify UAV targets of regular size; Liu et al. proposed a UAV recognition method based on the SSD algorithm, which separated the detection and classification of UAV targets, but had problems of low recognition accuracy and inaccurate positioning; Zhou et al. replaced the backbone network of the SSD algorithm with MobileNety2 and introduced a feature pyramid network to improve the detection accuracy of UAV targets, but the detection effect of UAV targets in complex scenes was not good and the robustness was poor; Wang et al. improved the detection speed of the SSD algorithm by cutting the number of convolution channels of the backbone network, and introduced a feature enhancement module to improve the detection performance. The detection speed was greatly improved, but the detection accuracy was low. Summary of the invention
[0006] The present application provides a low-altitude UAV target detection algorithm based on improved SSD to solve the problems in the above-mentioned background technology.
[0007] The technical solution adopted by this application to solve its technical problem is: a low-altitude UAV target detection algorithm based on improved SSD, including:
[0008] Step 1: Collect publicly available labeled data to train the SSD object detection model, and introduce the channel attention module and the Transformer-based feature fusion module in turn;
[0009] Step 2: Based on the SSD target detection model in step 1, the primary detection results are obtained, and the non-maximum suppression operation is used to remove the redundant frames detected and retain the optimal detection results;
[0010] Step 3: Define the loss function, back-propagate the loss value to each layer of the SSD target detection model, calculate the gradient of each layer parameter, and update the weight output in the model;
[0011] Step 4: Determine whether the current number of iterations has reached the set threshold. If not, repeat steps 1 to 3. If yes, select the optimal weight from the obtained weights.
[0012] Step 5: Evaluate the test set used to train the SSD target detection model based on the optimal weights and obtain the average precision as the detection result.
[0013] This low-altitude UAV target detection algorithm based on improved SSD uses the SSD artificial intelligence algorithm to detect low-altitude UAV flying targets. Compared with traditional sound wave, radio, and radar detection methods, it has the advantages of low cost, universality, and high precision. By introducing the channel attention module to the SSD algorithm, the target missed detection situation is improved and the algorithm robustness is improved. By introducing the feature fusion module based on the Transformer network layer to the SSD algorithm, the feature information loss problem is solved by fusing feature maps of different scales, thereby improving the detection accuracy of small targets. In addition, this connection and fusion method enhances the semantic understanding of the target and effectively improves the SSD algorithm's detection ability for small targets.
[0014] Preferably, in step one, the SSD target detection model introduces a channel attention module including: global average pooling, activation and feature weighting. The global average pooling performs a global pooling operation on the input X, and the dimension of X is C×H×W, where C, H, and W represent the number of channels, length, and width of the feature map, respectively, to obtain a one-dimensional array of length C. Based on the SSD target detection algorithm, a global pooling operation is performed on the high-level feature map, and a channel attention mechanism is introduced.
[0015] Preferably, in step 1, the SSD target detection model introduces a channel attention module including:
[0016] Global average pooling: Perform global average pooling on the feature maps of each layer of the SSD target detection model, calculate the average pixel value of all feature maps, and use the average pixel value to represent the corresponding feature map, thereby obtaining the global information of each channel;
[0017] Activation: Use ReLU nonlinear activation function and Sigmoid activation function to model the correlation between channels;
[0018] Feature weighting: The information of the original feature channel is weighted with the modeled weight.
[0019] Preferably, the activation process is to model the correlation between the channels, and the calculation formula includes:
[0020] , where the dimension of W1 is C'×C, the dimension of W2 is C×C', in this algorithm, C' defaults to C×1 / 4, Z is a one-dimensional array of length C obtained after global average pooling, and the final dimension of S is C×1×1.
[0021] Preferably, during weighting, the original input X is replaced with the feature X' obtained through the channel attention module and introduced into the original network structure for target detection, X'=X×S.
[0022] As a preferred method, in order to solve the problem of missing position information and semantic information in small target detection, this method introduces a feature fusion module of the network layer with the Transformer structure as the core between the high-level and low-level feature maps in the SSD structure. The Transformer-based feature fusion module includes an upsampling module and multiple Transformer layers. The upsampling module uses a bilinear interpolation method to achieve feature upsampling, thereby retaining the spatial structure and detail information of the features. The Transformer layer uses a self-attention mechanism for feature fusion.
[0023] Preferably, the feature fusion formula of the i-th module of the feature fusion module of the Transformer includes:
[0024] , where F i(in) Input feature map for layer i; F i(out) is the output feature map of the i-th layer; MHA is the multi-head self-attention mechanism; C i (i=1,2,3,4,5,6) represents different feature extraction layers; when i<6, F i(in) After summing, multiply by F i(in) The result is used as the input of the FFN layer in the Transformer structure; when i=6, the result of C6 summation and direct multiplication by C6 is selected as the input of the FFN layer in the Transformer structure; the FFN layer has two layers, which expands the weighted features in the channel attention module by 4 times and then reduces the dimension; the LN layer is a normalization technology, which adjusts each sub-layer to the [0,1] interval by calculating the mean and variance, and uses it as the F i(out) The results are output.
[0025] As a preference, the loss function is defined as the weighted sum of position loss and confidence loss. The position loss function uses SmoothL1 as the loss function. Since the positive sample error and the negative sample error constitute the classification loss error, there is an imbalance between positive and negative samples. To ensure the stability of the network structure, the confidence loss function introduces the Focal loss function to replace the original Softmax loss function of the SSD algorithm.
[0026] As a preference, the Focal loss function is as follows:
[0027] , where Pos is the positive sample set, Neg is the negative sample set, and p i is the probability that the i-th sample is predicted as a positive sample or a negative sample; γ is an adjustable factor. When γ = 0, the FocalLoss function is equivalent to the Softmax function; when γ increases, (1-p i ) γ Also increases,γ adjusts the proportion of weights by balancing the easy-to-classify samples.
[0028] The substantial effects of this application are:
[0029] 1. This low-altitude UAV target detection algorithm based on improved SSD detects low-altitude UAV flight targets by using the SSD artificial intelligence algorithm. Compared with traditional sound wave, radio, and radar detection methods, it has the advantages of low cost, universality, and high precision. By introducing the channel attention module to the SSD algorithm, the target missed detection situation is improved and the algorithm robustness is improved. By introducing the feature fusion module based on the Transformer network layer to the SSD algorithm, the feature information loss problem is solved by fusing feature maps of different scales, and the small target detection accuracy is improved. In addition, this connection and fusion method enhances the semantic understanding of the target and effectively improves the SSD algorithm's detection ability for small targets;
[0030] 2. By performing global pooling operations on high-level feature maps of the SSD algorithm and introducing a channel attention mechanism, the semantic information of high-level feature maps is enhanced, the target missed detection is improved, and the robustness of the algorithm is improved;
[0031] 3. By introducing a feature fusion module based on the Transformer network layer into the SSD algorithm, the problem of feature information loss is solved by fusing feature maps of different scales, thereby improving the accuracy of small target detection. In addition, this connection and fusion method enhances the semantic understanding of the target and effectively improves the SSD algorithm's ability to detect small targets;
[0032] 4. The Focal Loss function based on binary cross entropy CE is used as the confidence regression loss function to replace the original Softmax Loss function in the SSD algorithm. Through a dynamic scaling factor, the weight of easily distinguishable samples can be dynamically reduced during training, thereby quickly focusing on those difficult-to-distinguish samples and adjusting the ratio between the positive and negative sample losses. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flowchart of the steps of an embodiment of the present application;
[0034] Figure 2 It is a flow chart of the SSD target detection model that introduces the channel attention module in an embodiment of the present application;
[0035] Figure 3 It is a structural diagram of the feature fusion module of the Transformer in the embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solution of the present application is further described below through specific embodiments. Example
[0037] Due to their advantages in concealment, flexibility and maneuverability, low-altitude UAVs are developing towards intelligence, modularization and clustering, but their indiscriminate flying poses a challenge to safety protection. To deal with this threat, this application proposes a low-altitude UAV target detection algorithm based on improved SSD. Based on the original SSD algorithm, a global pooling operation is performed on the high-level feature map, and the semantic information of the high-level feature map is enhanced by combining the channel attention mechanism. The feature fusion module based on the Transformer network layer is used to fuse feature information at different scales. Finally, the Focal Loss function is used as the confidence regression loss function to deal with the uneven number of positive and negative samples. This allows the optimized SSD algorithm to have better detection accuracy and robustness for low-altitude UAV targets in complex scenarios. Specifically, Figure 1-3 As shown, including:
[0038] Step 1: Collect public labeled data to train the SSD object detection model, and introduce the channel attention module and the Transformer-based feature fusion module in turn.
[0039] During training, the public labeled data is divided into training set, validation set and test set. Before training, some pictures are randomly selected from the training set and processed by horizontal flip, vertical flip, random brightness, Gaussian blur, mean smoothing filter and random hue saturation operations, but no modification is made in the validation set and test set. The resolution of all data sets is scaled and set to a fixed 300x300 pixels. During the training process, the training set and test set are always kept independent of each other.
[0040] In step 1, the SSD target detection model introduces the channel attention module including:
[0041] Global average pooling: Perform a global average pooling operation on the feature maps of each layer of the SSD target detection model, add all the pixel values of the feature map and average them to get a value, use this value to represent the corresponding feature map, and thus obtain the global information of each channel. The global average pooling operation specifically includes: performing a global pooling operation on the input X, the dimension of X is C×H×W, where C, H, and W represent the number of channels, length, and width of the feature map, respectively, to obtain a one-dimensional array of length C. The specific calculation formula is as follows:
[0042] , where (i, j) represents the point with horizontal and vertical coordinates i and j on the feature map of size H×W, h and w are the length and width of the feature map, and the output Z is a one-dimensional array of length C;
[0043] Activation: Use the ReLU nonlinear activation function and the Sigmoid activation function to model the correlation between channels. The activation process is to model the correlation between channels. The calculation formula includes:
[0044] ,
[0045] Among them, the dimension of W1 is C'×C, the dimension of W2 is C×C', in this algorithm, C' defaults to C×1 / 4, Z is a one-dimensional array of length C obtained after global average pooling, and the final dimension of S is C×1×1.
[0046] Feature weighting: The information of the original feature channel is weighted with the modeled weight, specifically including: replacing the original input X with the feature X' obtained through the channel attention module, and introducing it into the original network structure for target detection, X'=X×S.
[0047] In summary, the flow chart of the SSD target detection model with the channel attention module is as follows: Figure 2 shown.
[0048] After the channel attention module is introduced, a feature fusion module based on Transformer is added to the SSD object detection model with the channel attention module to comprehensively utilize semantic information at different levels. Figure 3 As shown in Figure 1, the Transformer-based feature fusion module includes an upsampling module and multiple Transformer layers. The upsampling module uses a bilinear interpolation method to achieve feature upsampling, thereby retaining the spatial structure and detail information of the features. The Transformer layer uses a self-attention mechanism to perform feature fusion. The structure of the feature fusion module is shown in Figure 1. Figure 3 As shown, for the i-th module, C i(i=1,2,3,4,5,6) represents different feature extraction layers, namely conv4_3, conv7, conv8_2, conv9_2, conv10_2, conv11_2; the input feature map is F i(in) , the output feature map is F i(out) , where F i(in) It is obtained by upsampling the output feature map of the previous layer. Specifically, the feature fusion formula of the i-th module of the feature fusion module of Transformer includes:
[0049] , where F i(in) Input feature map for layer i; F i(out) is the output feature map of the i-th layer; MHA is the multi-head self-attention mechanism; C i (i=1,2,3,4,5,6) represents different feature extraction layers; when i<6, F i(in) After summing, multiply by F i(in) The result is used as the input of the FFN layer in the Transformer structure; when i=6, the result of C6 summation and direct multiplication by C6 is selected as the input of the FFN layer in the Transformer structure; the FFN layer has two layers, which expands the weighted features in the channel attention module by 4 times and then reduces the dimension; the LN layer is a normalization technology, which adjusts each sub-layer to the [0,1] interval by calculating the mean and variance, and uses it as the F i(out) The results are output.
[0050] Step 2: Based on the SSD target detection model in step 1, the primary detection results are obtained, and the non-maximum suppression operation is used to remove the redundant detected boxes and retain the optimal detection results.
[0051] Step 3: Define the loss function, back-propagate to each layer of the SSD target detection model according to the loss value, calculate the gradient of each layer parameter, and update the weight output in the model. The loss function is defined as the weighted sum of position loss and confidence loss, and the expression is:
[0052] , where N is the number of positive samples; x={0,1}, that is, if the predicted box matches the true box, x is 1, and if it does not match, x is 0; c is the target category confidence prediction value; l is the position prediction value of the target corresponding to the bounding box, g is the position parameter of the true box, and α is the position loss weight parameter, which is set to 1.
[0053] For the position regression loss function, SmoothL1 is used as the loss function, which is defined as follows:
[0054] , where pos is the positive sample set, Indicates whether the i-th predicted box matches the j-th real box in category k; m is the parameter set of the traversal bounding box, and its value is {c x ,c y ,w,h},c x ,c y is the center coordinate, w is the width, and h is the height; Represents the value of the mth parameter of the jth true box after encoding. The specific encoding method is shown in the following formula:
[0055] ,in, represents the coordinates of the center point of the jth real box, is the center point coordinate of the predicted box that matches the jth true box, Indicates the width and height of the prediction box; It is the encoding of the width and height of the real box, indicating the width and height of the jth real box.
[0056] In the position regression loss function, That is, the difference between the predicted value and the target value, denoted as x, then the expression of SmoothL1 is:
[0057] .
[0058] For confidence regression loss, since the positive sample error and negative sample error constitute the classification loss error, there is an imbalance between positive and negative samples. To ensure the stability of the network structure, this paper introduces the Focal loss function to replace the original Softmax loss function of the SSD algorithm and constructs a new classification confidence loss function as follows:
[0059] , where Pos is the positive sample set, Neg is the negative sample set, and p i is the probability that the i-th sample is predicted as a positive sample or a negative sample; γ is an adjustable factor. When γ = 0, the FocalLoss function is equivalent to the Softmax function; when γ increases, (1-p i ) γ Also increases,γ adjusts the proportion of weights by balancing the easy-to-classify samples.
[0060] Step 4: Determine whether the current number of iterations has reached the set threshold. If not, repeat steps 1 to 3. If yes, select the optimal weight from the obtained weights.
[0061] Step 5: Evaluate the test set used to train the SSD target detection model based on the optimal weights and obtain the average precision as the detection result.
[0062] The above-described embodiment is only a preferred solution of the present application and does not limit the present application in any form. There are other variations and modifications without exceeding the technical solution described in the claims.
Claims
1. A low-altitude UAV target detection method based on improved SSD, characterized in that: include: Step 1: Collect publicly available labeled data to train the SSD target detection model, and introduce the channel attention module and the Transformer-based feature fusion module in turn. The channel attention module introduced in the SSD target detection model includes: global average pooling, activation and feature weighting. Global average pooling includes: performing global average pooling operations on the feature maps of each layer of the SSD target detection model, calculating the average pixel values of all feature maps, and using the average pixel value to represent the corresponding feature map, thereby obtaining the global information of each channel; activation includes: using the ReLU nonlinear activation function and the Sigmoid activation function to model the correlation between channels; feature weighting includes: weighting the information of the original feature channel with the modeled weight. The activation process is to model the correlation between channels. The calculation formula includes: , Among them, the dimension of W1 is C'×C, the dimension of W2 is C×C', in this algorithm, C' defaults to C×1 / 4, Z is a one-dimensional array of length C obtained after global average pooling, and the final dimension of S is C×1×1; the Transformer-based feature fusion module includes an upsampling module and multiple Transformer layers. The upsampling module uses a bilinear interpolation method for operation, and the Transformer layer uses a self-attention mechanism for feature fusion; the feature fusion formula of the i-th module of the Transformer feature fusion module includes: , Among them, F i(in) Input feature map for layer i; F i(out) is the output feature map of the i-th layer; MHA is the multi-head self-attention mechanism; C i (i=1,2,3,4,5,6) represents different feature extraction layers; when i<6, F i(in) After summing, multiply by F i(in) The result is used as the input of the FFN layer in the Transformer structure; when i=6, the result of C6 summation and direct multiplication by C6 is selected as the input of the FFN layer in the Transformer structure; the FFN layer has two layers, which expands the weighted features in the channel attention module by 4 times and then reduces the dimension; the LN layer is a normalization technology, which adjusts each sub-layer to the [0,1] interval by calculating the mean and variance, and uses it as the F i(out) The results are output; Step 2: Based on the SSD target detection model in step 1, the primary detection results are obtained, and the non-maximum suppression operation is used to remove the redundant frames detected and retain the optimal detection results; Step 3: Define the loss function, back-propagate the loss value to each layer of the SSD target detection model, calculate the gradient of the parameters of each layer, and update the weight output in the model. The loss function is defined as the weighted sum of the position loss and the confidence loss. The position loss function uses SmoothL1 as the loss function, and the confidence loss function introduces the Focal loss function to replace the original Softmax loss function of the SSD algorithm. The Focal loss function is as follows: , Among them, Pos is the positive sample set, Neg is the negative sample set, and p i is the probability that the i-th sample is predicted as a positive sample or a negative sample; γ is an adjustable factor. When γ = 0, the FocalLoss function is equivalent to the Softmax function; when γ increases, (1-p i ) γ It also increases,γ,which reduces the proportion of weights by balancing the easy-to-separate samples; Step 4: Determine whether the current number of iterations has reached the set threshold. If not, repeat steps 1 to 3. If yes, select the optimal weight from the obtained weights. Step 5: Evaluate the test set used to train the SSD target detection model based on the optimal weights and obtain the average precision as the detection result.
Citation Information
Patent Citations
Small target detection method based on attention mechanism
CN114202672A
Aerial target detection method based on deep learning
CN116152632A