A UAV tracking method based on improved DeepSORT algorithm
Through the improved DeepSORT algorithm, combined with the channel attention module, Mish activation function and feature pyramid, the problem of difficulty in balancing accuracy and speed in UAV detection and tracking is solved, and more efficient UAV tracking and detection are achieved.
Patent Information
- Application Number
- CN202110918288.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-08-11
AI Technical Summary
Existing drone detection and tracking technology is difficult to balance between accuracy and speed, resulting in ID hopping and tracking ‘frame loss’ problems.
The improved DeepSORT algorithm is used to extract video stream features through the ResNet50-vd structure integrated with the channel attention module and Mish activation function. ResNet50 is introduced in the tracking stage to replace the original network architecture, using feature pyramid and Margin Loss loss function to improve Detection accuracy and tracking accuracy.
It improves UAV detection accuracy and tracking stability, reduces the number of false alarms, solves the problem of ID hopping and tracking ‘frame loss’, and enhances the tracking ability of multiple UAVs.
Smart Images

Figure CN113822153B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection and tracking, and in particular to a drone tracking method based on an improved DeepSORT algorithm. Background Art
[0002] The rapid development of drones has brought convenience and fun to people, but it has also brought great safety risks, such as interfering with flight operations, carrying dangerous goods, and infringing on others' privacy. Therefore, it is very necessary to use existing technologies to detect intruding drones in a timely manner, which requires accurate detection and stable tracking methods.
[0003] At present, the detection methods for drones can be divided into four categories: radar, vision, acoustics, and radio frequency systems. Tracking drones is mainly achieved using radar and vision systems. Radar uses electromagnetic waves to detect targets and has the advantage of long detection distance, but the equipment is complex, expensive, and easily interfered with; radio frequency technology is to detect drones by listening to the communication between drones and their controllers to achieve drone positioning. This technology will fail on drones that are pre-programmed and do not require real-time communication control; acoustic technology uses the unique acoustic characteristics emitted by drone propellers to distinguish drones, which is easy to misjudge in noisy environments such as cities, and the distance is limited; visual detection, also known as optical detection, is a technology that uses optoelectronic devices such as cameras to collect images and then further processes the images. Although it does not have the advantage of distance, it is sought after by many scholars because of its simple detection equipment, convenient feature extraction, and the ability to provide additional visual information that other drone detection systems cannot provide, such as drone models, sizes, and payloads. These technologies have their own advantages and disadvantages. Although visual detection has certain advantages, it is also prone to ID jumps and tracking "frame loss" problems when tracking multiple drones at the same time. Summary of the invention
[0004] The purpose of the present invention is to provide a drone tracking method based on an improved DeepSORT algorithm, aiming to solve the problems of ID jumping and tracking "frame loss" caused by the inability to balance detection accuracy and tracking speed in the prior art.
[0005] To achieve the above object, the present invention adopts a UAV tracking method based on an improved DeepSORT algorithm, comprising the following steps:
[0006] Step 1: Input the video stream containing the drone target and process it frame by frame;
[0007] Step 2: Input the video frame generated in step 1 into the backbone network to extract features and obtain a feature map;
[0008] Step 3: Input the feature map into the feature pyramid FPN for fusion;
[0009] Step 4: Converge the model to obtain the predicted position and confidence information of the UAV target;
[0010] Step 5: Using the predicted position information as input, assign a tracker to the detection box;
[0011] Step 6: Initialize the Kalman filter and use the Kalman filter to predict the position of the target in the current frame;
[0012] Step 7: Perform matching calculation on the drone target in step 4 and the predicted target in step 6;
[0013] Step 8: Update the tracker and Kalman filter and output the matching calculation results.
[0014] Among them, the backbone network is ResNet50-vd that incorporates the channel attention module and Mish activation function.
[0015] Among them, in the process of inputting the video frame generated in step 1 into the backbone network to extract features and obtain feature maps, the attention module is used to capture the dependency between channels, and achieve the purpose of highlighting the drone target through weight distribution, so that the detection network shares weights and improves detection accuracy; the Mish activation function eliminates the gradient disappearance problem of the ReLU function during the back propagation process.
[0016] In the process of inputting the feature map into the feature pyramid FPN for fusion, the feature map output in step 2 is input into the feature pyramid FPN, and features are extracted from images of various scales to generate multi-scale feature representations.
[0017] In the process of converging the model to obtain the predicted position and confidence information of the UAV target, the model is converged under the action of the loss function, and the non-maximum suppression is used to remove the interference targets to obtain the predicted position and confidence information of the UAV target.
[0018] In the process of matching the drone target in step 4 and the predicted target in step 6, the confidence value of the drone target is used as the basis for classification matching calculation.
[0019] If the confidence level is greater than 0.7, the drone target is cascade matched with the predicted target;
[0020] If the confidence is less than or equal to 0.7, the drone target is matched with the predicted target by IOU.
[0021] Among them, the cascade matching uses the cosine distance and Mahalanobis distance of the drone appearance as the cost matrix, the appearance description part uses ResNet50 to replace the original network architecture, and introduces the loss function Margin Loss to increase the matching accuracy, and the IOU matching is implemented using the Hungarian algorithm.
[0022] In the process of updating the tracker and Kalman filter and outputting the matching calculation results, the prediction box and ID are output for the successfully matched target, and the target trajectory that failed to match is deleted.
[0023] The invention discloses a drone tracking method based on an improved DeepSORT algorithm. The ResNet50-vd structure incorporating a channel attention module and a Mish activation function is used as a backbone network to extract features from a drone video stream. In the process, the channel attention module enables the network to focus on important input information and exclude interference from other information. In addition, the Mish activation function is used to replace the ReLU function, thereby improving the information flow of negative gradients during training. In addition, a feature pyramid is used to increase the network's perception of small-target drones. In the tracking stage, the appearance description part of the cascade matching process is improved on the basis of the DeepSORT algorithm, ResNet50 is used to replace the original network architecture, and a loss function Margin Loss is introduced to improve the tracking effect, thereby solving the problems of ID jump, tracking "frame loss", etc. in the prior art due to the inability to balance detection accuracy and tracking speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 It is a flow chart of a UAV tracking method based on an improved DeepSORT algorithm of the present invention.
[0026] Figure 2 It is a specific flow chart of a UAV tracking method based on an improved DeepSORT algorithm of the present invention.
[0027] Figure 3 It is a channel attention module structure diagram of a drone tracking method based on an improved DeepSORT algorithm of the present invention.
[0028] Figure 4It is a feature pyramid module structure diagram of a UAV tracking method based on an improved DeepSORT algorithm of the present invention.
[0029] Figure 5 This is the ResNet50-vd structure diagram of the backbone network of the present invention that introduces the Mish activation function. DETAILED DESCRIPTION
[0030] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0031] See also Figure 1 The present invention proposes a UAV tracking method based on an improved DeepSORT algorithm, comprising the following steps:
[0032] S1: Input the video stream containing the drone target and process it frame by frame;
[0033] S2: Input the video frame generated in S1 into the backbone network to extract features and obtain a feature map;
[0034] S3: Input the feature map into the feature pyramid FPN for fusion;
[0035] S4: The converged model obtains the predicted position and confidence information of the UAV target;
[0036] S5: using the predicted position information as input and assigning a tracker to the detection frame;
[0037] S6: Initialize the Kalman filter and use the Kalman filter to predict the position of the target in the current frame;
[0038] S7: Perform matching calculation on the UAV target in S4 and the predicted target in S6;
[0039] S8: Update the tracker and Kalman filter and output the matching calculation results.
[0040] The backbone network is ResNet50-vd that incorporates a channel attention module and a Mish activation function.
[0041] In the process of inputting the video frames generated in S1 into the backbone network to extract features and obtain feature maps, the attention module is used to capture the dependencies between channels, and achieve the purpose of highlighting the drone target through weight distribution, so that the detection network shares weights and improves detection accuracy; the Mish activation function eliminates the gradient vanishing problem of the ReLU function during the back propagation process.
[0042] In the process of inputting the feature map into the feature pyramid FPN for fusion, the feature map output in step 2 is input into the feature pyramid FPN, and features are extracted from images of various scales to generate multi-scale feature representations.
[0043] In the process of converging the model to obtain the predicted position and confidence information of the UAV target, the model is converged under the action of the loss function, and non-maximum suppression is used to remove interference targets to obtain the predicted position and confidence information of the UAV target.
[0044] In the process of matching the UAV target in S4 and the predicted target in S6, the confidence value of the UAV target is used as the basis for classification matching calculation.
[0045] If the confidence level is greater than 0.7, the drone target is cascade matched with the predicted target;
[0046] If the confidence is less than or equal to 0.7, the drone target is matched with the predicted target by IOU.
[0047] The cascade matching uses the cosine distance and Mahalanobis distance of the drone appearance as the cost matrix. The appearance description part uses ResNet50 to replace the original network architecture, and introduces the loss function Margin Loss to increase the matching accuracy. The IOU matching is implemented using the Hungarian algorithm.
[0048] In the process of updating the tracker and Kalman filter and outputting the matching calculation results, the prediction box and ID are output for the successfully matched target, and the target track that failed to match is deleted.
[0049] The UAV tracking method based on the improved DeepSORT algorithm is specifically divided into two processing steps: detection and tracking. By using detection and tracking separation processing measures, the number of false alarms is reduced, the tracking frame is stabilized, and the tracking effect is improved. For the specific process, please refer to Figure 2 .
[0050] Furthermore, the present invention is further described in detail below with reference to the accompanying drawings:
[0051] 1. Channel Attention Module
[0052] Channel attention establishes interdependencies between feature channels, obtains the weights of each feature channel, and based on the weights, enhances the features that the current task focuses on and suppresses features that do not contribute to the current task. Its structure is as follows Figure 3 As shown in the figure, the input X is assumed to be the obtained feature map. First, after convolution and transformation, a feature map with c feature channels is obtained. Then, the two-dimensional feature channel is compressed to one dimension in the spatial dimension, so that it has a global receptive field. At the same time, it ensures that the feature extraction layer near the input can also obtain a global receptive field, thereby improving the perception of the target. Next is the excitation operation, which uses the parameter w to generate the weight of each channel and passes it to the subsequent feature layer through feature mapping. Finally, the weights generated by the excitation are weighted to the previous feature channels one by one, thus completing the construction of the attention module in the channel dimension.
[0053] The compression operation uses global average pooling to compress the feature layer of the input channel. The result after compressing the spatial dimension of the feature map u is shown in formula (1).
[0054]
[0055] z c Represents the one-dimensional vector value of the cth feature. h and w represent the two dimensions of the feature map respectively.
[0056] The excitation operation will learn the nonlinear interactions between channels. First, the feature dimension is reduced to 1 / 16 of the input through a fully connected layer, and then the nonlinearity is increased through the ReLU activation function. Then, a fully connected layer is used to restore the original dimension. These two fully connected layers together form a bottleneck structure to evaluate the correlation between channels. Finally, the normalized weights are obtained through the Sigmoid function. The expression of the excitation operation is shown in (2):
[0057] s=F ex (z,w)=σ(g(z,w))=σ(w2δ(w1z)) (2)
[0058] Among them, σ refers to the Sigmoid function, δ is the ReLU function, g(z,w) represents the bottleneck structure composed of two fully connected layers, and the dimension of w1 is The dimension of w2 is r is a scaling parameter.
[0059] After the compression and excitation operations are completed, the multiplication is weighted channel by channel to the original features as shown in formula (3).
[0060]
[0061] At this point, the channel attention module has been integrated into the detection network, which has improved the detection accuracy of drones to a certain extent.
[0062] 2. Feature Pyramid FPN
[0063] Feature Pyramid FPN connects high-level features and low-level features from top to bottom, so that features at all scales have rich semantic information. For the specific structure, please refer to Figure 4 FPN can effectively generate multi-dimensional feature expressions in a single image view by utilizing the conventional convolutional network model to express the feature structures of different dimensions of the same image from bottom to top. Its core idea includes two parts: the bottom-up feature generation part of different dimensions and the top-down feature supplementation and enhancement part.
[0064] The bottom-up part is the forward process of the convolutional neural network. In the forward process, the size of the feature map will change after passing through some layers, but will not change when passing through other layers. The layers that do not change the size of the feature map are grouped into one stage. Therefore, each extracted feature is the output of the last layer of each stage, thus forming a feature pyramid. Figure 4 Among them, C2, C3, and C4 are feature layers, and P2, P3, and P4 are corresponding feature mapping layers. By fusing different feature layers, the network's perception ability for drones of different scales is increased.
[0065] 3. Mish activation function
[0066] In the task of detecting drone targets, drones usually occupy a very small proportion of the image. Therefore, when using convolution operations to extract features, it is easy to make the input zero or negative, resulting in slow gradient descent or even disappearance. Only by ensuring the gradient flow in the negative area can the features of small target drones be better extracted and the detection be more accurate.
[0067] The Mish activation function is a self-regularized non-monotonic neural activation function that retains a small amount of negative information and allows a small negative gradient to flow in, thereby ensuring information flow and eliminating the gradient vanishing problem of the ReLU function during back propagation, thereby allowing better information to flow into the neural network and ultimately achieving better accuracy and generalization ability. Its function expression is shown in (4).
[0068] f(x)=x*tanh(log(1+e x )) (4)
[0069] In view of this, the Mish activation function is introduced into the ResNet50-vd backbone network. The specific structure is as follows Figure 4 As shown in the figure: In each residual block, the activation function of the BN layer in the first two convolutional layers adopts the Mish function to stabilize the training process and improve the generalization ability of the model.
[0070] 4. Appearance Description of Cascade Matching
[0071] The deep appearance description part of the original Deep-SORT algorithm only uses a wide residual network consisting of two convolutional layers and six residual blocks. It is feasible for large targets such as cars and pedestrians, but it is very easy to fail when matching drone targets. Therefore, ResNet50 is used to replace the original CNN network architecture to increase the ability to extract drone features. The metric learning method is used to introduce the loss function Margin Loss, which improves the class separability, strengthens the intra-class compactness, and increases the inter-class difference. Its calculation formula is shown in (5):
[0072]
[0073] Where N is the batch size, n is the number of classes, θ yi is the weight W yi and feature x i The angle between them, m is the additional angle penalty bias term, and s is the feature x i The feature scale is scaled after l2 regularization. MarginLoss constructs the loss function by analyzing the angle statistics between features and weights, which improves the model's discrimination ability and stabilizes the training process without adding any additional computational overhead.
[0074] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A UAV tracking method based on an improved DeepSORT algorithm, characterized in that: The following steps are involved: Step 1: Input the video stream containing the drone target and process it frame by frame; Step 2: Input the video frame generated in step 1 into the backbone network to extract features and obtain a feature map; The backbone network is ResNet50-vd with channel attention module and Mish activation function; Step 3: Input the feature map into the feature pyramid FPN for fusion; Step 4: Converge the model to obtain the predicted position and confidence information of the UAV target; Step 5: Using the predicted position information as input, assign a tracker to the detection box; Step 6: Initialize the Kalman filter and use the Kalman filter to predict the position of the target in the current frame; Step 7: Perform matching calculation on the drone target in step 4 and the predicted target in step 6; In the process of matching the drone target in step 4 and the predicted target in step 6, the confidence value of the drone target is used as the basis for classification matching calculation. If the confidence level is greater than 0.7, the drone target is cascade matched with the predicted target; If the confidence is less than or equal to 0.7, the drone target is matched with the predicted target by IOU; The cascade matching uses the cosine distance and Mahalanobis distance of the drone appearance as the cost matrix. The appearance description part uses ResNet50 to replace the original network architecture, and introduces the loss function MarginLoss to increase the matching accuracy. The IOU matching is implemented using the Hungarian algorithm; Step 8: Update the tracker and Kalman filter and output the matching calculation results; Channel attention establishes the interdependence between feature channels, obtains the weight of each feature channel, and enhances the features that the current task focuses on according to the weight, and suppresses the features that do not contribute to the current task. Assuming that the input X is the obtained feature map, first after convolution and transformation, a feature map with c feature channels is obtained, and then the two-dimensional feature channel is compressed to one dimension in the spatial dimension, so that it has a global receptive field. At the same time, it ensures that the feature extraction layer near the input also obtains a global receptive field, improving the perception of the target; followed by the excitation operation, using the parameter w to generate the weight of each channel and pass it to the subsequent feature layer through feature mapping; finally, the weights generated by the excitation are weighted to the previous feature channels one by one, completing the construction of the attention module in the channel dimension; The compression operation uses global average pooling to compress the feature layer of the input channel. The result after compressing the spatial dimension of the feature map u is shown in formula (1): z c Represents the one-dimensional vector value of the c-th feature, h and w represent the two dimensions of the feature map respectively; The excitation operation will learn the nonlinear interaction between channels. First, the feature dimension is reduced to 1 / 16 of the input through a fully connected layer, and then the nonlinearity is increased through the ReLU activation function. Then, a fully connected layer is used to restore the original dimension. These two fully connected layers together form a bottleneck structure to evaluate the correlation between channels. Finally, the normalized weight is obtained through the Sigmoid function. The expression of the excitation operation is shown in (2): s=F ex (z,w)=σ(g(z,w))=σ(w2δ(w1z))(2) Among them, σ refers to the Sigmoid function, δ is the ReLU function, g(z,w) represents the bottleneck structure composed of two fully connected layers, and the dimension of w1 is The dimension of w2 is r is a scaling parameter; After the compression and excitation operations are completed, the multiplication is weighted channel by channel to the original features as shown in formula (3), At this point, the channel attention module has been integrated into the detection network to improve the detection accuracy of drones.
2. The drone tracking method based on the improved DeepSORT algorithm as claimed in claim 1, characterized in that: In the process of inputting the video frame generated in step 1 into the backbone network to extract features and obtain feature maps, the attention module is used to capture the dependency between channels, and achieve the purpose of highlighting the drone target through weight distribution, so that the detection network shares weights and improves detection accuracy; The Mish activation function eliminates the gradient vanishing problem of the ReLU function during back propagation.
3. The drone tracking method based on the improved DeepSORT algorithm as claimed in claim 1, characterized in that: In the process of inputting the feature map into the feature pyramid FPN for fusion, the feature map output in step 2 is input into the feature pyramid FPN, and features are extracted from images of various scales to generate multi-scale feature representations.
4. The drone tracking method based on the improved DeepSORT algorithm as claimed in claim 1, characterized in that: In the process of converging the model to obtain the predicted position and confidence information of the UAV target, the model is converged under the action of the loss function, and non-maximum suppression is used to remove interference targets to obtain the predicted position and confidence information of the UAV target.
5. The drone tracking method based on the improved DeepSORT algorithm as claimed in claim 1, characterized in that: In the process of updating the tracker and Kalman filter and outputting the matching calculation results, the prediction box and ID are output for the successfully matched target, and the target track that failed to match is deleted.
