Lightweight unmanned aerial vehicle real-time target tracking method based on twin network and attention mechanism

By using the twin network and attention mechanism in the UAV target tracking model, combined with the lightweight backbone network and feature enhancement layer, the speed and accuracy problems of the UAV target tracking model on devices with limited computing power are solved, and the speed and accuracy of the UAV target tracking model are achieved. Efficient small target tracking in complex environments.

CN118570254AActive Publication Date: 2024-08-30HEFEI UNIV OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410685440.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-08-30
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

Existing UAV target tracking models run slowly on devices with limited computing power, making it difficult to achieve real-time tracking. Moreover, the tracking accuracy is not high in poor light or complex environments. It is especially difficult to respond to fast-moving targets and is difficult to detect on UAVs. Achieve a balance between accuracy and speed in the scene.

Method used

A lightweight UAV real-time target tracking method based on twin network and attention mechanism is adopted. MobileNetV3 is used as the backbone network, combined with CSAM and CLPAM attention mechanism layers, to improve feature extraction capabilities and reduce background interference through feature enhancement and feature fusion networks. Improve the tracking accuracy and speed of small targets.

Benefits of technology

It improves the target tracking accuracy and speed of UAVs in complex environments, reduces model size and computational complexity, is suitable for UAV scenarios with limited storage space and calculation, and achieves high-precision tracking of small targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570254A
    Figure CN118570254A
Patent Text Reader

Abstract

The invention discloses a lightweight unmanned aerial vehicle real-time target tracking method based on a twin network and an attention mechanism. The method comprises the following steps: 1, constructing a data set by using a video sequence collected by camera equipment carried by an unmanned aerial vehicle; 2, establishing an unmanned aerial vehicle video object tracking model, using a lightweight network as a backbone network, using an attention mechanism to enhance information expression of a tracking target, using a convolution module with different convolution kernels to decouple classification and regression tasks in a tracking process, and realizing more accurate target position tracking; 3, constructing a loss function, and training iteration until parameters of the network converge; 4, dot matrix convolution cross-correlation operation is used during model tracking, and the tracking speed is increased while the tracking precision is kept. According to the method, the specified target position in the unmanned aerial vehicle video sequence can be identified, and the method is of great significance in improving the target tracking precision and speed of the unmanned aerial vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of unmanned aerial vehicle vision, and in particular to a target tracking network improvement method based on a twin network, and in particular to a unmanned aerial vehicle target tracking model training and a target tracking method. Background Art

[0002] Drones have unique application potential in the field of target tracking. For example, in search and rescue operations, drones can be equipped with advanced camera equipment and sensors to conduct real-time aerial monitoring, quickly and accurately locate missing persons or analyze disaster sites. The high maneuverability and wide field of view of drones make them ideal surveillance tools, enabling efficient monitoring and tracking in hard-to-reach areas. As a platform for dynamic surveillance, drones can not only capture subtle dynamic changes on the ground by carrying high-resolution cameras, but also automatically identify and track moving targets on the ground through real-time video analysis technology. The application of this technology is particularly suitable for border patrols, traffic monitoring, and wildlife protection. Drones can observe and track for a long time without interfering with the target.

[0003] Target tracking is an important basic research field in computer vision. Its main work is to locate the object of interest in the image and to classify the category to which the object belongs. In recent years, with the development of machine learning and deep learning technologies, the target tracking capability of drones has been significantly improved. Traditional methods manually extract the feature information required for target object tracking in video sequences, including HOG+SVM, KCF and other methods, which have become less and less applicable and are gradually replaced by intelligent analysis methods. Through deep neural networks, drones can achieve simultaneous recognition and tracking of multiple targets in complex scenes, and maintain high tracking accuracy even in poor lighting or weather conditions. This intelligent tracking system not only improves the efficiency of target tracking, but also enhances the automation and intelligence level of the tracking process.

[0004] Since drone video images contain rich target information, existing tracking models use deep and complex backbone networks to extract features from images, which affects the deployment of models on devices with limited computing power such as drones. The algorithm's running speed is limited, making it difficult to achieve real-time tracking. At the same time, drone target tracking technology still faces some challenges. For example, the stability and image quality of drone images are affected by flight altitude and environmental factors, which may reduce the accuracy of the tracking algorithm. In addition, for fast-moving targets, traditional target tracking algorithms may have difficulty responding in real time, resulting in tracking failures. Existing target tracking models have not been able to achieve a good balance between accuracy and speed, making them difficult to apply in drone scenarios. Summary of the invention

[0005] The present invention aims to solve the shortcomings of the above-mentioned prior art and proposes a lightweight UAV real-time target tracking method based on a twin network and an attention mechanism, in order to improve the feature extraction capability of the model backbone network, increase the running speed of the algorithm in the UAV scenario, and improve the tracking accuracy of smaller-scale tracking targets, thereby providing support for the subsequent use of UAVs for real-time target tracking, which is of great significance to the application of target tracking algorithms in UAV scenarios.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:

[0007] The invention discloses a lightweight UAV real-time target tracking method based on a twin network and an attention mechanism, which comprises the following steps:

[0008] Step 1: Obtain N drone aerial video datasets with target location information and target foreground and background classification information and perform preprocessing such as cropping, scaling and filling to obtain the preprocessed drone aerial video dataset {K1, K2, ..., K n ,...,K N}; Kn represents the nth drone aerial video after preprocessing, and K n,j Represents the nth drone aerial video K n The j-th frame image in the image, N represents the total number of drone aerial videos, m n Represents the nth drone aerial video K n The total number of frames;

[0009] Step 2: Build a target tracking network, including: backbone network, feature enhancement network, feature fusion network, and output end;

[0010] Step 2.1, the backbone network includes: a template image feature extraction branch and a search image feature extraction branch;

[0011] The template image feature extraction branch is K n,1 Perform feature extraction to obtain the first frame template image feature map

[0012] The search image feature extraction branch is K n,j Perform feature extraction to obtain the j-th frame search image feature map where j∈[2,m n ];

[0013] Step 2.2, the feature enhancement network includes: a CSAM attention mechanism layer and a CLPAM attention mechanism layer;

[0014] After being processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer, the channel displacement enhancement map of the first frame template image is obtained accordingly. And the local high-frequency feature enhancement map of the first frame template image

[0015] After being processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer, the corresponding j-th frame search image channel displacement enhancement map is obtained: And the j-th frame search image local high-frequency feature enhancement map

[0016] Step 2.3, the feature fusion network includes: a multi-feature fusion layer, a downsampling layer and a cross-correlation layer;

[0017] and After being processed by the multi-feature fusion layer, the cascade feature map of the first frame template is obtained. After inputting into the downsampling layer for processing, the template fusion feature map of the first frame is obtained.

[0018] and After being processed by the multi-feature fusion layer, the j-th frame search cascade feature map is obtained After being input into the downsampling layer for processing, the j-th frame search fusion feature map is obtained

[0019] The cross-correlation layer will Respectively After performing the dot matrix convolution cross-correlation operation, the j-th frame target tracking feature map N is output n,j ∈R H×W×c ; H represents the height of the feature map, W represents the width of the feature map, and c represents the number of channels;

[0020] Step 2.4, the output end includes: a classification regression task decoupling module and a target pre-selection box calculation module;

[0021] The classification regression decoupling module is used for N n,j Process and output the j-th frame classification feature map And the j-th frame regression feature map Among them, w represents the width of the classification and regression feature maps, and h represents the height of the classification and regression feature maps;

[0022] The target pre-selection box calculation module and Processing is performed to obtain the predicted j-th frame tracking target position information and target foreground and background classification information;

[0023] Step 3: Construct loss function:

[0024] Construct the IOUloss loss based on the target position information marked in the dataset and the tracking target position information predicted by the model;

[0025] The classification loss is constructed using cross entropy based on the target foreground and background classification information annotated in the dataset and the foreground and background classification information predicted by the model;

[0026] Step 4: Use the stochastic gradient descent method to train the target tracking network, and calculate the IOU loss and classification loss to update the network parameters until the two losses converge or the maximum number of iterations is reached, then stop the training to generate a target tracking model corresponding to the optimal parameters, which is used to predict the position of the tracked target in the image and obtain the tracked target position.

[0027] The lightweight UAV real-time target tracking method of the present invention is also characterized in that the CSAM attention mechanism layer in step 2.2 is composed of a channel shift module and a SplitAttention module in sequence;

[0028] The channel displacement module uses formula (1) to obtain the displacement feature map of the j-th frame search image on the i-th channel:

[0029]

[0030] In formula (1), MLP represents multi-layer perceptron; Spatial Shift i Represents the shift operation of the i-th channel;

[0031] The SplitAttention module uses formula (2) to obtain the j-th frame search image channel displacement enhancement map

[0032]

[0033] In formula (2), 1 is an n-dimensional row vector of all 1s, σ is the GELU activation function, and W1 and W2 represent the two weights of the multi-layer perceptron MLP;

[0034] The CLPAM attention mechanism layer uses a fully connected layer to Perform linear transformation operation to obtain query features Matching Features and information characteristics Again Perform deep convolution operations to obtain aggregated features Thus, using formula (3), we can get the local high-frequency feature enhancement map of the j-th frame search image:

[0035]

[0036] In formula (3), ⊙ represents the Hardmard product, FC represents the fully connected layer, DWconv represents the depthwise convolution, d represents the number of channels, Tanh represents the hyperbolic tangent function, Represents the query features and matching features The context-aware weights obtained after a series of operations. Add represents element addition, and Swish and Softmax represent two different activation functions.

[0037] The cross-correlation layer in step 2.3 is obtained using formula (4);

[0038]

[0039] In formula (4), Represents the search image feature map In the uth row and vth column position, Represents the template image feature map The kth row and lth column position, m and n represent the template fusion feature map The height and width of the

[0040] The classification regression decoupling module in step 3 is obtained using formula (5) and

[0041]

[0042] In formula (5), Maxpool represents the maximum pooling operation, Conv1, Conv2, and Conv3 represent convolution operations with three different convolution kernels, and Softmax represents the activation function.

[0043] The electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the lightweight unmanned aerial vehicle real-time target tracking method, and the processor is configured to execute the program stored in the memory.

[0044] The present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, which is characterized in that when the computer program is run by a processor, the steps of the lightweight unmanned aerial vehicle real-time target tracking method are executed.

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

[0046] 1. The present invention uses the lightweight backbone network MobileNetV3 as the backbone. Compared with the traditional deep neural network backbone, it has the characteristics of fewer parameters, less calculation amount, and shorter inference time. It is more suitable for drone scenarios with limited storage space and calculation.

[0047] 2. The present invention constructs a CSAM attention mechanism layer and a CLPAM attention mechanism layer in the feature enhancement network, embeds the attention mechanism after the twin network backbone network to obtain the target feature map to be tracked, and enhances the feature information expression of the target in the drone image from the two dimensions of space and channel, so that the model can focus on the target itself and reduce the interference of complex background. The channel displacement module of CSAM enables channels of different dimensions to absorb visual content from adjacent channels, which can realize communication between spatial positions, allowing the network to better understand the spatial structure of input data, improve the perception of spatial relationships, and help to more accurately capture fine-grained visual information and better deal with small targets. CLPAM uses deep convolution with shared weights to extract local representations and uses context-aware weights to enhance local features, which enables the network to effectively extract local features when facing local complex environments, and improves the expression ability of local features and the accuracy of target tracking.

[0048] 3. The present invention utilizes a classification-regression decoupling module with convolutions of different sizes to decouple the classification and regression tasks of target tracking, utilizes a small-kernel convolution to complete the regression task that is more sensitive to the edge information of the object, and utilizes a large-kernel convolution layer to complete the classification task of distinguishing the foreground and background of the tracked target, thereby improving the accuracy of the model in classifying the foreground and background, and especially improving the accuracy of the bounding box regression of the fine-grained tracked target. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of a method for training a target tracking model according to an embodiment of the present invention;

[0050] Figure 2 is a structural diagram of a target tracking model according to an embodiment of the present invention;

[0051] Figure 3 is a schematic diagram of the structure of the CSAM attention mechanism layer according to an embodiment of the present invention;

[0052] Figure 4 Schematic diagram of the structure of the CLPAM attention mechanism layer according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In this embodiment, Figure 1 As shown in the figure, a lightweight UAV real-time target tracking method based on a twin network and an attention mechanism includes the following steps:

[0054] Step 1: Get N drone aerial video datasets with location labels and perform preprocessing such as cropping, scaling and filling to obtain the preprocessed drone aerial video dataset {K1, K2, ..., K n ,...,K N}; Kn represents the nth drone aerial video after preprocessing, and K n,j represents the jth frame image in the nth drone aerial video, N represents the total number of drone aerial videos, m n represents the total number of frames of the nth drone aerial video; in this embodiment, K n,1 The size is 127×127×3, K n,j ,j∈[2,m n ] has a size of 255×255×3.

[0055] Step 2: Build a target tracking network, such as Figure 2 As shown, it includes: a backbone network, a feature enhancement network, a feature fusion network, and an output end; wherein the backbone network includes two feature extraction branches, namely, a template image branch and a search image branch, and each branch uses a lightweight backbone network; the feature enhancement network is composed of a CSAM attention mechanism layer and a CLPAM attention mechanism layer; the feature fusion network includes a cascade layer, a downsampling layer, and a cross-correlation layer; the output end includes: a classification regression task decoupling module (TransConv) and a target pre-selection box calculation module;

[0056] Any m frames of drone aerial video sequence images with label information are input into the target tracking network as the current batch training data.

[0057] Step 2.1: Input the first frame image K of the video sequence n,1 Input into the template network for feature extraction to obtain the first frame template image feature map The subsequent frame images K of the preprocessed video sequence n,j Input into the search network for feature extraction to obtain the j-th frame search image feature map Where j∈[2,m]; In the specific embodiment, the backbone networks of the template network and the search network are both lightweight networks MobileNetV3, which include improved depth-separable convolutions, which can significantly reduce model parameters and computational complexity, and use SE modules to enhance the network's representation capabilities by explicitly modeling the dependencies between feature channels. This mechanism helps the network better focus on useful information and compress unimportant information.

[0058] Step 2.2: Template feature map The input is sent to the feature enhancement network, and after being processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer, the channel displacement enhancement map of the first frame template image is obtained. And the local high-frequency feature enhancement map of the first frame template image At the same time, the search feature map The input is sent to the feature enhancement network and processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer respectively, and the corresponding channel displacement enhancement map of the j-th frame search image is obtained. And the j-th frame search image local high-frequency feature enhancement map

[0059] The CSAM attention mechanism layer consists of a channel shift module and a SplitAttention module in sequence, such as Figure 3 As shown in the figure, the channel displacement module uses formula (1) to obtain the displacement feature map of the j-th frame search image on the i-th channel:

[0060]

[0061] In formula (1), MLP represents a multi-layer perceptron, which is used to expand the input c-channel feature map into a 3c-channel feature map; Spatial Shift i Represents the bit shift operation of the i-th channel.

[0062] The SplitAttention module uses formula (2) to obtain the channel displacement enhancement map of the j-th frame search image

[0063]

[0064] In formula (2), 1 is an n-dimensional row vector of all 1s, σ is the GELU activation function, and W1 and W2 represent the two weights of the multi-layer perceptron MLP.

[0065] The CLPAM attention mechanism layer uses the fully connected layer to Perform linear transformation to obtain query features Matching Features and information characteristics Again Perform deep convolution operations to obtain aggregated features Thus, using formula (3), we can get the local high-frequency feature enhancement map of the j-th frame search image: like Figure 4 As shown;

[0066]

[0067] In formula (3), ⊙ represents the Hardmard product, FC represents the fully connected layer, DWconv represents the depthwise convolution, d represents the number of channels, Tanh represents the hyperbolic tangent function, Represents the query features and matching features The context-aware weights obtained after a series of operations. Add represents element addition, and Swish and Softmax represent two different activation functions.

[0068] In the specific implementation process, input Transformed by the fully connected layer and After that, we first use the shared weight DWconv Information aggregation is performed. After that, Swish, a nonlinear method that is stronger than traditional attention, is used to generate context-aware weights. These weights are then used to enhance local features. In CLPAM, shared weights and context-aware weights are utilized. Compared with traditional convolutions, the use of context-aware weights in CLPAM enables the model to better adapt to the input content during local perception. The introduction of shared weights enables the model to better handle high-frequency information, thereby improving performance. In addition, the method of generating context-aware weights introduces stronger nonlinearity, resulting in better performance. And all operations used in CLPAM are based on convolution, retaining the translation equivariance property of convolution.

[0069] Step 2.3: Enhance the template image features and And search image feature enhancement map and Input into the multi-feature fusion network, and after cascade operation, the cascade fusion feature map of the first frame is obtained. And the j-th frame cascade fusion feature map After the image downsampling path is processed, the fused feature map is obtained and

[0070] The cross-correlation layer will Respectively After performing the dot matrix convolution cross-correlation operation, the j-th frame target tracking feature map N is output n,j ∈R H×W×c ; H represents the height of the feature map, W represents the width of the feature map, and c represents the number of channels.

[0071] The cross-correlation operation calculates the similarity by directly multiplying the corresponding elements in the two feature maps; the similarity calculation is achieved by formula (4);

[0072]

[0073] In formula (4), Represents the search image feature map In the uth row and vth column position, Represents the template image feature map The kth row and lth column position, m and n represent the template fusion feature map The height and width of the

[0074] Step 2.4: Output classification regression decoupling module (TransConv) for N n,j Process and output the j-th frame classification feature map And the j-th frame regression feature map Among them, w represents the width of the classification and regression feature maps, and h represents the height of the classification and regression feature maps;

[0075] The classification regression decoupling module uses formula (5) to process the input features;

[0076]

[0077] In formula (5), Maxpool represents the maximum pooling operation, Softmax represents the activation function, and Conv1, Conv2, and Conv3 represent convolution operations with three different convolution kernels; the convolution kernel size of Conv1 is 1×1, the convolution kernel size of Conv2 is 3×3, and the convolution kernel size of Conv3 is 5×5.

[0078] Target pre-selection box calculation module and Processing is performed to obtain the predicted j-th frame tracking target position information and target foreground and background classification information; in this embodiment, c=6.

[0079] Specifically, the classification feature map Each point (i, j, :) contains a 2D vector that represents the foreground and background scores of the corresponding position in the input search area; regression feature map Each point (i, j, :) in contains a 4D vector t(i, j) = (l, t, r, b) representing the distances from the corresponding position to the four edges of the bounding box in the input search area.

[0080] Step 3: Construct loss function:

[0081] Construct the IOUloss loss based on the target position information marked in the dataset and the tracking target position information predicted by the model;

[0082] The classification loss is constructed using cross entropy based on the target foreground and background classification information annotated in the dataset and the foreground and background classification information predicted by the model;

[0083] Let (x0, y0) and (x1, y1) represent the upper left corner and lower right corner of the true bounding box, (x, y) represents the corresponding position of point (i, j), and the regression target It can be calculated by formula (6);

[0084]

[0085] pass The IOU between the real bounding box and the predicted box can be calculated. The regression loss is calculated by formula (7);

[0086]

[0087] The cross entropy loss of classification is calculated by formula (8);

[0088]

[0089] Among them, y is the true label (0 or 1), and p is the probability predicted by the model, that is, the probability that the model predicts the positive class.

[0090] Step 4: Use the stochastic gradient descent method to train the target tracking network, use the IOU loss to calculate the predicted target bounding box loss, and use the cross entropy loss to calculate the classification loss until the loss converges or the maximum number of iterations is reached, then stop training to generate the optimal target tracking network and its optimal parameters;

[0091] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.

[0092] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.

[0093] The experiment is based on the 64-bit operating system Ubuntu 22.04, the CPU is Intel Core i7-12700k, the graphics card is Nvidia GeForce RTX 3080, and Python3.8, Pytorch1.7.0, and CUDA11.3 are used as the algorithm running environment. The datasets used for overall model training are composed of GOT-10k, LaSOT, ImageNet DET, COCO, ImageNet VID, and Youtube-BB. The backbone network uses MobileNetV3 pre-trained on ImageNet. The initial learning rate of the model is set to 0.005, and the SGD optimizer is used for optimization. The learning rate gradually decreases from 0.005 to 0.0005. A total of 50 epochs are trained, and the batch size is set to 64.

[0094] In the experiment, an offline tracking method is used, and only the objects in the initial frame of the video sequence are used as tracking templates. The evaluation indicators include precision, which is the Euclidean distance between the center point of the predicted box and the center point of the real annotation box. The threshold is 20 pixels, and their Euclidean distance is within 20 pixels. The tracking is considered successful. The success rate is the intersection ratio of the pixels in the area of ​​the predicted box and the real annotation box. The ratio of the number of video frames with an overlap rate greater than 50% between the tracking prediction rectangle and the annotation box to the total number of frames in the entire video is calculated. FPS (Frames Per Second) is used as the evaluation indicator of the model detection speed.

[0095] The trained network is tested on the DTB70 dataset. The tracking model size of the present invention is only 5.6MB, which is much smaller than other target tracking network model sizes. Compared with other mainstream tracking algorithms, it has the characteristics of small model and high tracking accuracy, as shown in Table 1. Prec represents accuracy, Succ represents success rate, Model Size represents model size, and FPS represents model detection speed.

[0096] Table 1 Comparison of experimental results on the DTB70 dataset

[0097]

[0098] In order to verify the influence of the proposed various improvement strategies on the model detection effect, an ablation experiment was conducted on the UAV123 dataset, and the results are shown in Table 2. Among them, “√” represents the introduction of the proposed structure, CSAM and CLPAM are the two proposed attention mechanism layers, and TransConv is the proposed classification regression decoupling module.

[0099] Table 2 Comparison of ablation experiment results

[0100]

[0101] The results show that the target tracking effect of the present invention is better than that of the mainstream target tracking models. In terms of the evaluation accuracy index, the target detection model proposed in the present invention achieves the best effect, while balancing the model size and speed. This shows that the present invention has good application space and prospects, and provides methods and ideas for the practical application of drones in target tracking in the future.

Claims

1. A lightweight UAV real-time target tracking method based on twin network and attention mechanism, characterized in that: The following steps are involved: Step 1: Obtain N drone aerial video datasets with target location information and target foreground and background classification information and perform preprocessing such as cropping, scaling and filling to obtain the preprocessed drone aerial video dataset {K1, K2, ..., K n ,...,K N }; where K n represents the nth drone aerial video after preprocessing, and K n,j Represents the nth drone aerial video K n The j-th frame image in the image, N represents the total number of drone aerial videos, m n Represents the nth drone aerial video K n The total number of frames; Step 2: Build a target tracking network, including: backbone network, feature enhancement network, feature fusion network, and output end; Step 2.1, the backbone network includes: a template image feature extraction branch and a search image feature extraction branch; The template image feature extraction branch K n,1 Perform feature extraction to obtain the first frame template image feature map The search image feature extraction branch is K n,j Perform feature extraction to obtain the j-th frame search image feature map where j∈[2,m n ]; Step 2.2, the feature enhancement network includes: a CSAM attention mechanism layer and a CLPAM attention mechanism layer; After being processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer, the channel displacement enhancement map of the first frame template image is obtained accordingly. And the local high-frequency feature enhancement map of the first frame template image After being processed by the CSAM attention mechanism layer and the CLPAM attention mechanism layer, the corresponding j-th frame search image channel displacement enhancement map is obtained: And the j-th frame search image local high-frequency feature enhancement map j∈[2,m n ]; Step 2.3, the feature fusion network includes: a multi-feature fusion layer, a downsampling layer and a cross-correlation layer; and After being processed by the multi-feature fusion layer, the cascade feature map of the first frame template is obtained. After inputting into the downsampling layer for processing, the template fusion feature map of the first frame is obtained. and After being processed by the multi-feature fusion layer, the j-th frame search cascade feature map is obtained After being input into the downsampling layer for processing, the j-th frame search fusion feature map is obtained j∈[2,m n ]; The cross-correlation layer will Respectively After performing the dot matrix convolution cross-correlation operation, the j-th frame target tracking feature map N is output n,j ∈R H×W×c ; H represents the height of the feature map, W represents the width of the feature map, and c represents the number of channels; Step 2.4, the output end includes: a classification regression task decoupling module and a target pre-selection box calculation module; The classification regression decoupling module is used for N n,j Process and output the j-th frame classification feature map And the j-th frame regression feature map Among them, w represents the width of the classification and regression feature maps, and h represents the height of the classification and regression feature maps; The target pre-selection box calculation module and Processing is performed to obtain the predicted j-th frame tracking target position information and target foreground and background classification information; Step 3: Construct loss function: Construct the IOU loss based on the target position information marked in the dataset and the tracking target position information predicted by the model; The classification loss is constructed using cross entropy based on the target foreground and background classification information annotated in the dataset and the foreground and background classification information predicted by the model; Step 4: Use the stochastic gradient descent method to train the target tracking network, and calculate the IOU loss and classification loss to update the network parameters until the two losses converge or the maximum number of iterations is reached, then stop the training to generate a target tracking model corresponding to the optimal parameters, which is used to predict the position of the tracked target in the image and obtain the tracked target position.

2. The lightweight UAV real-time target tracking method according to claim 1 is characterized in that: The CSAM attention mechanism layer in step 2.2 is composed of a channel shift module and a Split Attention module in sequence; The channel displacement module uses formula (1) to obtain the displacement feature map of the j-th frame search image on the i-th channel: In formula (1), MLP represents multi-layer perceptron; Spatial Shift i Represents the shift operation of the i-th channel; The Split Attention module uses formula (2) to obtain the j-th frame search image channel displacement enhancement map In formula (2), 1 is an n-dimensional row vector of all 1s, σ is the GELU activation function, and W1 and W2 represent the two weights of the multi-layer perceptron MLP; The CLPAM attention mechanism layer uses a fully connected layer to Perform linear transformation operations to obtain query features Matching Features and information characteristics Again Perform deep convolution operation to obtain aggregated features Thus, using formula (3), we can get the local high-frequency feature enhancement map of the j-th frame search image: In formula (3), ⊙ represents the Hardmard product, FC represents the fully connected layer, DWconv represents the depthwise convolution, d represents the number of channels, Tanh represents the hyperbolic tangent function, Represents the query features and matching features The context-aware weights obtained after a series of operations. Add represents element addition, and Swish and Softmax represent two different activation functions.

3. The lightweight UAV real-time target tracking method according to claim 2 is characterized in that: The cross-correlation layer in step 2.3 is obtained using formula (4); In formula (4), Represents the search image feature map In the uth row and vth column position, Represents the template image feature map The kth row and lth column position, m and n represent the template fusion feature map The height and width of the 4. The lightweight UAV real-time target tracking method according to claim 3 is characterized in that:The classification regression decoupling module in step 3 is obtained using formula (5) and In formula (5), Maxpool represents the maximum pooling operation, Conv1, Conv2, and Conv3 represent convolution operations with three different convolution kernels, and Softmax represents the activation function.

5. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the lightweight unmanned aerial vehicle real-time target tracking method as described in any one of claims 1-4, and the processor is configured to execute the program stored in the memory.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the lightweight unmanned aerial vehicle real-time target tracking method described in any one of claims 1 to 4 are executed.

Citation Information

Cited By

  • Wild animal single target tracking method based on improved twin network

    CN119540285A

  • Unmanned aerial vehicle automatic airport operation power prediction method

    CN119740005A

  • Embedded real-time single target tracking method based on feature clustering twin network

    CN120259367A