Unmanned aerial vehicle multi-target tracking method based on computer vision

By combining the Holistic Trans-Detector module and the GAO-Trajectory Matching Pattern trajectory association module with the Holistic self-attention mechanism and the visual Gaussian mixture probability hypothesis density filter, the problems of occlusion, high computational complexity and insufficient real-time performance in UAV visual multi-target tracking technology are solved, achieving stable tracking and efficient matching in complex scenarios.

CN118887256APending Publication Date: 2024-11-01NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411056364.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

Existing UAV visual multi-target tracking technologies face challenges in terms of occlusion and environmental changes, high computational complexity, real-time requirements, and insufficient generalization ability, especially in environments with dense targets or dynamic changes where effective data association is difficult.

Method used

The Holistic Trans-Detector module is used for target detection and feature extraction. Combined with the GAO-Trajectory Matching Pattern trajectory association module, the Holistic self-attention mechanism, GAO trajectory matching mechanism and visual Gaussian mixture probability hypothesis density filter (VGM-PHD) are used. Feature extraction and target matching are performed through the Holistic Transformer layer and Anchor-Free prediction head.

Benefits of technology

It improves the robustness and accuracy of UAV multi-target tracking, effectively handles target occlusion and cross-movement in complex scenarios, reduces computational complexity, meets real-time requirements, and enhances the algorithm's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887256A_ABST
    Figure CN118887256A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision, in particular to an unmanned aerial vehicle multi-target tracking method based on computer vision, the method is realized based on an unmanned aerial vehicle aerial photography multi-target tracking system, the unmanned aerial vehicle aerial photography multi-target tracking system is composed of a Holistic Trans-Detector module and a GAO-Trajectory Matching Pattern trajectory association module, and the method comprises Holistic Trans-Detector target detection and feature extraction; a Holistic self-attention mechanism is established; an Anchor-Free prediction head is designed; according to the method, local and global interaction information of the target can be captured at the same time, the overall dynamic state of the scene can be understood, a necessary basis is provided for unmanned aerial vehicle aerial video multi-target trajectory tracking in crowded and small target scenes, and the motion trajectory of the target can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to a method for tracking multiple targets of an unmanned aerial vehicle based on computer vision. Background Art

[0002] With its excellent performance, drone visual multi-target tracking technology has shown broad application prospects in many fields. In the military field, this technology can be used for tasks such as enemy reconnaissance, target identification and strike, significantly improving combat effectiveness and reducing combat risks. In the field of security monitoring, drones can quickly and accurately detect and track criminal suspects, traffic violations, etc., thereby effectively improving the effectiveness of urban security, traffic monitoring and security of major events.

[0003] In addition, in the field of environmental monitoring, drone visual multi-target tracking technology also plays an important role. It can help monitor and warn of forest fires, water pollution, and track animal migration, greatly improving the accuracy and efficiency of environmental monitoring.

[0004] Multi-target tracking technology is an important research direction in the field of computer vision. It involves the ability to detect, identify and continuously track multiple targets from video sequences. Related technologies play a vital role in multi-target tracking. Data association is a key step in multi-target tracking. It is responsible for matching the detected targets with the previous trajectory states to ensure the continuity and accuracy of tracking. Common data association methods include nearest neighbor, joint probability data association and chi-square probability hypothesis density. In order to improve the accuracy and robustness of tracking, researchers have also proposed a variety of feature extraction and fusion methods, such as deep learning-based target detection algorithms, which provide high-precision feature descriptions.

[0005] In addition, the multi-information fusion method effectively handles the problems of target occlusion, false detection and loss by combining appearance information, trajectory history information and target motion information. The introduction of deep learning technology has greatly promoted the development of multi-target tracking technology. By training deep neural networks, adaptive learning of target appearance changes can be achieved, thereby improving tracking performance in complex environments.

[0006] In multi-target tracking, there are a series of problems that need to be solved;

[0007] First, occlusion and environmental changes are common challenges. The target may disappear temporarily or completely due to occlusion, or the environment may change due to factors such as lighting and weather, which will have an adverse effect on the tracking effect.

[0008] Secondly, computational complexity is another important issue. Although a variety of algorithms have been proposed to solve the problem of multi-target tracking, most algorithms still face the challenge of high computational complexity when dealing with large-scale scenes.

[0009] In addition, real-time requirements are also a factor that cannot be ignored in many application scenarios, especially in the fields of autonomous driving and real-time monitoring systems. Current multi-target tracking algorithms often cannot meet the strict real-time requirements. Data association is one of the core issues of multi-target tracking. How to effectively perform data association is still a challenge, especially in environments with dense or dynamically changing targets.

[0010] Finally, the generalization ability of the algorithm is also an important issue. Although existing multi-target tracking algorithms perform well on specific data sets, they often lack sufficient generalization ability and have difficulty adapting to different application scenarios and environmental changes.

[0011] In summary, it is necessary to propose a UAV multi-target tracking method based on computer vision to solve the above problems. Summary of the invention

[0012] The purpose of the present invention is to provide a method for tracking multiple targets of an unmanned aerial vehicle based on computer vision to solve the problems raised in the above-mentioned background technology.

[0013] To achieve the above object, the present invention provides the following technical solutions:

[0014] A method for tracking multiple targets of unmanned aerial vehicles based on computer vision is implemented based on a multi-target tracking system for unmanned aerial vehicle photography. The multi-target tracking system for unmanned aerial vehicle photography consists of a Holistic Trans-Detector module and a GAO-Trajectory Matching Pattern trajectory association module, and includes the following steps:

[0015] S1.Holistic Trans-Detector target detection and feature extraction, establish Holistic self-attention mechanism, and design Anchor-Free prediction head;

[0016] S2.GAO trajectory matching mechanism, performing Gau-IOU distance matching, Appear-IOU distance matching and OSPA-IOU distance matching;

[0017] S3. Visual Gaussian Mixture Probability Hypothesis Density Filter VGM-PHD.

[0018] Preferably, the specific implementation steps of step S1 Holistic Trans-Detector target detection and feature extraction are as follows:

[0019] To adapt to high-resolution visual tasks, high-resolution feature maps can be obtained at an early stage;

[0020] The entire model adopts a hierarchical design, which consists of 4 stages. Each stage reduces the resolution of the input feature map and expands the receptive field layer by layer like CNN.

[0021] At the beginning of the input, a Patch Embedding is made to cut the image into tiles and embed them into the Embedding.

[0022] In each stage, it consists of multiple Holistic Transformer Layers;

[0023] The specific structure of Holistic Transformer Layer is mainly composed of Layer Norm, MLP, and HolisticAttention;

[0024] The image with resolution H×W×3 is first divided into blocks of size 4×4, and the

[0025] Then use a convolutional layer with a kernel size and stride of 4 to project these patches into features of dimension d;

[0026] Given this spatial feature map, pass it to a four-stage cascade of Holistic Transformer layers;

[0027] At each stage, the Holistic Transformer block consists of 2, 2, 18, and 2 Holistic Transformer layers, respectively;

[0028] After each stage, a Patch Embedding layer is added to reduce the spatial size of the feature map by 2 times while increasing the feature dimension by 2 times;

[0029] Finally, the feature maps of all four stages are sent to the detector head, and the appearance feature vector of the target is output at the same time for matching of multi-target trajectories.

[0030] Preferably, the specific implementation steps of step S1 to establish the Holistic self-attention mechanism are as follows:

[0031] In a space of size M×N, x∈R M×N×d The feature map is first divided into 4×4 partitions, and each 4×4 partition is used as the feature perception core to perform attention perception from the surrounding ranges of different granularities;

[0032] Then, find the surroundings for each window;

[0033] Assume that the input feature map x∈R M×N×d, where M×N is the spatial dimension and d is the feature dimension;

[0034] The feature map is pooled in parallel with three levels of sub-windows l∈{1,2,4}. First, the input feature map x is divided into a sub-window grid of size l×l, and then a linear layer is used Pooling is performed in the spatial sub-window in the following way, see formula (1):

[0035]

[0036] in, The pooled feature maps at different levels l provide rich fine-grained and coarse-grained information;

[0037] Attention calculation;

[0038] After obtaining the pooled feature maps of all levels, three linear projection layers f are used q ,f k and f v Calculate the query of the first layer and the keys and values ​​of all layers, see equations (2), (3) and (4):

[0039] Q=f q (x 1 ) (2);

[0040] K l =f k (x l ) (3);

[0041] V l =f v (x l ) (4);

[0042] To perform holistic self-attention, you first need to extract the surrounding tokens for each query token in the feature map;

[0043] For the i-th window queries within, from the K surrounding the window l and V l Extract l×l keys and values ​​from i ∈R s×d and V i ∈R s×d , where s is the sum of the holistic regions from all levels, i.e. s = 8×8+6×6+5×5;

[0044] Finally, Q is calculated by i Holistic self-attention, see formula (5):

[0045]

[0046] In the formula, B={B l} is the learnable relative position bias;

[0047] For the first layer, it is parameterized as B 1 ∈R 7×7 For other holistic levels, considering that they have different granularity for queries, all queries within the window are treated equally and used To represent the query window and each pooled The relative position deviation between tokens;

[0048] Since the holistic self-attention of each window is independent of other windows, the attention can be calculated in parallel.

[0049] Preferably, the specific implementation steps of the step S1 of designing the Anchor-Free prediction head are as follows:

[0050] Design the Anchor-Free prediction head based on the CenterNet architecture and divide it into detection branch and appearance branch;

[0051] Feature extraction is performed through the Holistic Transformer, and the output feature map is provided to the two branches for object detection and appearance embedding;

[0052] The detection branch consists of three heads, which are used to predict the heat map, the center point offset of the object, and the size of the object;

[0053] The heat map head is used to predict the center position of the target, and its output dimension is h×w×Cls, where h and w are the height and width of the input feature map, respectively, and Cls is the number of all detection classes;

[0054] Each class has its own heatmap output, and each Gaussian peak in the heatmap represents the center position of the detected object;

[0055] Assume that there are N targets in the current training sample;

[0056] make represents the center position of the i-th target in i∈[1,N];

[0057] Then, calculate the heat map corresponding to the current training sample, see formula (6):

[0058]

[0059] In the formula, the operator Returns the integer a that is closest to a and smaller than σ c is the standard deviation parameter;

[0060] M∈R h×w×Cls Represents the output of the heat map head, M xy as the value at position (x,y);

[0061] The box size and center offset heads are used to predict the BBox of the target and the offset of the target center point respectively;

[0062] Will represents the BBox of the i-th target, and Respectively represent the upper left and lower right coordinates of the target;

[0063] At the same time, the center offset of the i-th target is defined as shown in formula (7);

[0064]

[0065] Will is represented as the output of the center offset head, and Expressed as The offset prediction of the i-th target at position (x, y) helps to improve the accuracy of the predicted target center position;

[0066] The appearance branch is responsible for generating embedded features that help identify objects. Each head consists of a 3×3 convolutional layer with 256 channels, followed by a 1×1 convolutional layer to produce the final output.

[0067] The appearance feature vector of the target is calculated using the embedding head of the appearance branch, which is used for the association matching operation in the multi-target tracking task;

[0068] Specifically, these appearance feature vectors are used for associative matching to compute the similarity between the tracker and the detected object;

[0069] In the formula, the 128-dimensional vector at the (x, y) position represents the appearance feature vector of the target at that position.

[0070] Preferably, the specific implementation steps of step S2 GAO trajectory matching mechanism are as follows:

[0071] The GAO track matching mechanism considers detection confidence, appearance embedding distance and IoU distance, and associates all tracking tracks with all detection Bboxes;

[0072] When the detection result output by the detector is received, the detected Bbox is divided into high-score detection boxes and low-score detection boxes according to the prediction confidence;

[0073] Next, these two Bboxes with different confidence levels use different matching methods for data association;

[0074] First, the updated predicted trajectory is matched with the high-score detection box, and the Appearance distance and IOU distance between the target and the predicted trajectory are comprehensively considered;

[0075] The unmatched high-score detection frame is matched again with the unmatched trajectory in the previous frame, taking into account the OSPA distance and IOU distance;

[0076] The high-scoring detection frames that are successfully matched twice are set as new tracks;

[0077] For low-score detection frames, analysis shows that most of them are small targets. In order to better extract target features, they are converted to Gaussian space. The Wasserstein distance and IOU distance between Gaussian distributions are considered, and the low-score detection frames that are not successfully matched will be deleted;

[0078] At the same time, all unmatched tracks with less than 30 consecutive unmatched frames are deleted from the tracking system;

[0079] In actual operation, the number of consecutive mismatched frames can vary according to the frame rate of the input video sequence;

[0080] The successfully matched tracking estimate uses the matched detection frame to perform an update process. During the update process, the trajectory prediction of the visual target is modeled as a random finite set, and the visual Gaussian mixture probability hypothesis density filter (VGM-PHD) is used to generate the tracker's prediction information to prepare the associated match for the next frame;

[0081] When performing data association, the detection BBox with a confidence score higher than 0.5 is added to the high-score detection BBox set, and the detection BBox with a confidence score between 0.2 and 0.5 is added to the low-score detection BBox set;

[0082] Four distance metrics are used in the proposed data association process. Based on these four distance metrics, three matching methods are designed, namely Gau-IOU distance matching, Appear-IOU and OSPA-IOU distance matching;

[0083] make Represents the i-th detected target detection BBox and the corresponding feature vector in the current frame, Represents the target BBox and corresponding feature vector predicted by the -th trajectory of the previous frame;

[0084] Calculate the first distance metric based on the IOU distance

[0085]

[0086] Here the IoU distance is defined as follows:

[0087]

[0088] Where ∩ and ∪ represent the intersection and union of two regions, respectively.

[0089] Preferably, the specific implementation steps of step S2 for performing Gau-IOU distance matching between the low-score detection frame and the trajectory are as follows:

[0090] Convert the BBox of the target and trajectory to Gaussian space by matrix transformation;

[0091] For the target box (x, y, w, h), the parameters N(x|μ, Σ) of the Gaussian distribution are calculated as

[0092] Gau-IOU trajectory matching, see equations (9) and (10);

[0093] μ=[x,y] T (9);

[0094]

[0095] The key to matching the detection box with the trajectory is how to calculate the Gaussian distribution N of the detection box. d (x d |μ d ,Σ d ) and the trajectory box Gaussian distribution N t (x t |μ t ,Σ t ) between them;

[0096] The Wasserstein distance is used to calculate the distance between two Gaussian distributions, see formula (11);

[0097]

[0098] The Wasserstein distance is mainly divided into two parts: the distance between the center points (x, y) and the coupling term about (h, w);

[0099] Since the parameters form a chain coupling relationship and influence each other, it is very conducive to high-precision matching.

[0100] Preferably, the specific implementation steps of step S2 Appear-IOU distance to complete the matching of the predicted trajectory with the high-score detection box are as follows:

[0101] The appearance vector of the target contains a lot of appearance information, which is combined with the IOU distance of the BBox to improve the matching accuracy between the detection box and the trajectory;

[0102] The second distance metric It is calculated based on the cosine distance between two embedded feature vectors, see formula (12):

[0103]

[0104] Here, “·” represents the dot product between two vectors, and ||A|| represents the 2-norm value of vector A.

[0105] Preferably, the specific implementation steps of step S2 OSPA-IOU distance completing the matching of the unmatched high-score detection frame with the unmatched trajectory of the previous frame are as follows:

[0106] OSPA distance allows considering sub-pattern matching of target trajectories, so that it can better capture the similarities and differences between target trajectories, thereby more accurately evaluating the tracking performance. Based on IOU distance matching, OSPA distance is comprehensively considered and an OSPA-IOU trajectory matching model is proposed.

[0107] Assume that the target state set is The target trajectory set is Represents the estimated number of targets and the actual number of targets;

[0108] The OSPA distance is expressed as formula (13);

[0109]

[0110] In the formula, Π n For Select all permutations and combinations of m numbers in the set;

[0111] If p = 1, the OSPA distance can be expressed as (14), (15) and (16):

[0112]

[0113] In the formula, are the position difference and potential difference between the target estimated state set and the target true state set, respectively;

[0114] The position difference reflects the actual spatial distance difference, and the potential difference reflects the performance parameters of false track ratio, redundant track ratio, and track interruption number;

[0115] The cutoff parameter c reflects the weight between position difference and potential difference. The smaller the parameter c is, the greater the weight of position difference is.

[0116] The target is regarded as a set of single elements and the trajectory is regarded as a set of multiple elements. The best matching of single detection and trajectory is achieved by calculating the OSPA distance between the two sets.

[0117] Preferably, the specific implementation steps of step S3 are as follows:

[0118] The visual GM-PHD filtering algorithm uses the center position of all trajectories as the measurement input of a random finite set, while retaining the ID and size information of the target and trajectory, which facilitates the restoration of the target trajectory;

[0119] At the same time, the following assumptions are made: the PHD of both the derived and new targets can be expressed as Gaussian mixture forms, the detection probability and survival probability of the target are independent of each other, and the state transition density function and observation likelihood function are both linear Gaussian models;

[0120] The motion model and observation model of the VGM-PHD filtering algorithm are both set to be linear, and the noise and error obey the Gaussian distribution;

[0121] The weight, mean and variance of PHD Gaussian distribution are used to recursively transfer multi-objective states.

[0122] The specific implementation steps of the VGM-PHD filtering algorithm are:

[0123] Assume that the posterior PHD at time k-1 is in the following Gaussian sum form:

[0124]

[0125] in are the weight, mean and covariance of the i-th Gaussian component at time k, x represents the state of a single target at time k, and J k Represents the number of Gaussian components at time k;

[0126] The function N(·) indicates that the variable follows a Gaussian distribution. The prediction strength function at time k is shown in (18):

[0127] T k∣k-1 (x) = T s,k∣k-1 (x)+T β,k∣k-1 (x)+γ k (x) (18);

[0128] The three terms on the right side of the formula are the predicted PHDs of the surviving target, the derived target, and the new target;

[0129] The intensity function updated by the GM-PHD filtering algorithm can be expressed as formula (19):

[0130]

[0131] Where, the first term represents the PHD of the missed target, and the second term represents the updated PHD of the detected target;

[0132] In the VGM-PHD filtering algorithm, if the PHD function at time k-1, the prior distribution generated by the prediction at time k, and the posterior distribution obtained by filtering and updating can all be expressed in the form of Gaussian mixture;

[0133] Its weight can be obtained by PHD filtering, and its mean and covariance can be obtained by Kalman filtering recursion;

[0134] While VGM-PHD is predicting and updating the target PHD, the number of predicted targets N k|k-1 and update target number N k , see equations (20) and (21):

[0135]

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

[0137] (1) Based on the Transformer architecture, the Holistic Transformer is designed to capture both local and global interactive information of the target. Global information helps to understand the overall dynamics of the scene, while local information can improve the recognition and tracking of small targets.

[0138] (2) An anchor-free detection head is used to generate more accurate target detection information, which provides the necessary basis for multi-target trajectory tracking in UAV aerial videos with crowded and small target scenes;

[0139] (3) The introduced GM-PHD method based on visual detection results can accurately predict the target motion trajectory and achieve continuous and stable tracking in UAV aerial videos, especially when the target moves fast or the scene changes frequently;

[0140] (4) The designed GAO trajectory matching mechanism comprehensively considers multiple factors such as Gaussian distance, Appearance distance, OSPA distance and IOU distance, which improves the robustness of the multi-target tracking model and can better cope with challenges in complex scenes such as target occlusion and cross-movement. BRIEF DESCRIPTION OF THE DRAWINGS

[0141] Figure 1 Shows a system block diagram of the present invention;

[0142] Figure 2 The specific structure diagram of the Holistic Transformer Layer of the present invention is shown;

[0143] Figure 3 The structure diagram of the Holistic Transformer of the present invention is shown;

[0144] Figure 4 The holistic self-attention module of the present invention first implements the sub-window pooling flow chart;

[0145] Figure 5 The architecture diagram of the post-processing module of the present invention is shown;

[0146] Figure 6 The Gau-IOU trajectory matching flow chart of the present invention is shown;

[0147] Figure 7 The Appear-IOU trajectory matching flow chart of the present invention is shown;

[0148] Figure 8 The OSPA-IOU trajectory matching flow chart of the present invention is shown. DETAILED DESCRIPTION

[0149] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0150] See also Figures 1 to 8 The present invention proposes a method for tracking multiple targets of unmanned aerial vehicles based on computer vision. The method is implemented based on a multi-target tracking system for unmanned aerial vehicle aerial photography. The multi-target tracking system for unmanned aerial vehicle aerial photography consists of a Holistic Trans-Detector module and a GAO-Trajectory Matching Pattern trajectory association module.

[0151] The Holistic Trans-Detector model is an anchor-free object detector and feature extraction module that integrates holistic self-attention and combines fine-grained local interactions with coarse-grained global interactions.

[0152] In this new mechanism, each token focuses on its nearest surrounding tokens at a fine granularity and its distant surrounding tokens at a coarse granularity, thus effectively capturing both short-term and long-term visual dependencies.

[0153] The GAO-Trajectory Matching Pattern trajectory association module processes the data association process by simultaneously considering three factors: detection confidence, appearance embedding distance, and IOU distance, thereby improving the tracking robustness of the MOT model.

[0154] Framework such as Figure 1 As shown;

[0155] Holistic Trans-Detector target detection and feature extraction:

[0156] To adapt to high-resolution visual tasks, high-resolution feature maps can be obtained at an early stage;

[0157] The whole model adopts a hierarchical design, which consists of four stages. Each stage will reduce the resolution of the input feature map and expand the receptive field layer by layer like CNN. The framework is as follows: Figure 2 As shown;

[0158] At the beginning of the input, a Patch Embedding is made to cut the image into tiles and embed them into the Embedding.

[0159] In each stage, it consists of multiple Holistic Transformer Layers;

[0160] The specific structure of Holistic Transformer Layer is as follows Figure 2 As shown, it is mainly composed of LayerNorm, MLP, and Holistic Attention;

[0161] The image with resolution H×W×3 is first divided into blocks of size 4×4, and the

[0162] Then use a convolutional layer with a kernel size and stride equal to 4 to project these patches into features of dimension d;

[0163] Given this spatial feature map, pass it to a four-stage cascade of Holistic Transformer layers;

[0164] At each stage, the Holistic Transformer block consists of 2, 2, 18, and 2 Holistic Transformer layers, respectively;

[0165] After each stage, a Patch Embedding layer is added to reduce the spatial size of the feature map by 2 times while increasing the feature dimension by 2 times;

[0166] Finally, the feature maps of all four stages are sent to the detector head, and the appearance feature vector of the target is output at the same time for matching multi-target trajectories;

[0167] Holistic self-attention mechanism:

[0168] The holistic mechanism can achieve long-range self-attention with less time and memory cost because it pays attention to a much smaller number of surrounding tokens;

[0169] However, in practice, extracting surrounding tokens for each query position is time-consuming and memory-intensive, since each token needs to be replicated for all queries that can access it. A common solution is to partition the input feature map into windows;

[0170] A space x∈R with size M×N M×N×d The feature map is first divided into 4×4 partitions, and each 4×4 partition is used as the feature perception core to perform attention perception from the surrounding ranges of different granularities;

[0171] Then, find the surroundings for each window instead of a single marker;

[0172] The Holistic self-attention module first implements sub-window pooling;

[0173] Process such as Figure 4 As shown;

[0174] Assume that the input feature map x∈R M×N×d , where M×N is the spatial dimension and d is the feature dimension;

[0175] The feature map is pooled in parallel with three levels of sub-windows l∈{1,2,4}. First, the input feature map x is divided into a sub-window grid of size l×l, and then a simple linear layer is used Pooling in spatial subwindows is done as follows:

[0176]

[0177] in, The pooled feature maps at different levels l provide rich fine-grained and coarse-grained information;

[0178] Attention calculation;

[0179] After obtaining the pooled feature maps of all levels, three linear projection layers f are used q ,f k and f v Calculate the query of the first layer and the key and value of all layers:

[0180] Q=f q (x 1 ) (2);

[0181] K l =f k (x l ) (3);

[0182] V l =f v (x l ) (4);

[0183] To perform holistic self-attention, you first need to extract the surrounding tokens for each query token in the feature map;

[0184] For the i-th window queries within, from the K surrounding the window l and V l Extract l×l keys and values ​​from i ∈R s×d and V i ∈R s×d , where s is the sum of the holistic regions from all levels, i.e. s = 8×8+6×6+5×5;

[0185] Finally, Q is calculated by i Holistic self-attention:

[0186]

[0187] Where B = {B l} is the learnable relative position bias;

[0188] For the first layer, it is parameterized as B 1 ∈R 7×7 For other holistic levels, considering that they have different granularity for queries, all queries within the window are treated equally and use To represent the query window and each pooled The relative position deviation between tokens;

[0189] Since the holistic self-attention of each window is independent of other windows, attention can be calculated in parallel;

[0190] Design Anchor-Free Prediction Head:

[0191] Anchor-Free prediction head is designed based on CenterNet architecture and divided into detection branch and appearance branch;

[0192] Feature extraction is performed through the Holistic Transformer, and the output feature map is provided to the two branches for object detection and appearance embedding;

[0193] The detection branch consists of three heads, which are used to predict the heat map, the center point offset of the object, and the size of the object;

[0194] The heat map head is used to predict the center position of the target, and its output dimension is h×w×Cls, where h and w are the height and width of the input feature map, respectively, and Cls is the number of all detection classes;

[0195] Each class has its own heatmap output, and each Gaussian peak in the heatmap represents the center position of the detected object;

[0196] Assume that there are N targets in the current training sample;

[0197] make represents the center position of the i-th target in i∈[1,N];

[0198] Then, calculate the heat map corresponding to the current training sample:

[0199]

[0200] Among them, the operator Returns the integer a that is closest to a and smaller than σ c is the standard deviation parameter;

[0201] M∈R h×w×Cls Represents the output of the heat map head, M xy as the value at position (x,y);

[0202] The box size and center offset heads are used to predict the BBox of the target and the offset of the target center point respectively;

[0203] Will represents the BBox of the i-th target, and Respectively represent the upper left and lower right coordinates of the target;

[0204] At the same time, the center offset of the i-th target is defined as:

[0205]

[0206] This helps improve the accuracy of predicting the target center location;

[0207] Will is represented as the output of the center offset head, and Expressed as Offset prediction of the i-th target at position (x, y);

[0208] The appearance branch is responsible for generating embedded features that help identify objects. Each head consists of a 3×3 convolutional layer with 256 channels, followed by a 1×1 convolutional layer to produce the final output.

[0209] The appearance feature vector of the target is calculated using the embedding head of the appearance branch, which is used for the association matching operation in the multi-target tracking task;

[0210] Specifically, these appearance feature vectors can be used for associative matching to compute the similarity between the tracker and the detected target;

[0211] Among them, the 128-dimensional vector at the (x, y) position represents the appearance feature vector of the target at that position;

[0212] GAO track matching mechanism:

[0213] The GAO track matching mechanism considers detection confidence, appearance embedding distance and IoU distance, and associates all tracking tracks with all detection Bboxes;

[0214] Figure 5 The architecture of the proposed post-processing module is explained;

[0215] When the detection result output by the detector is received, the detected Bbox is divided into high-score detection boxes and low-score detection boxes according to the prediction confidence;

[0216] Next, these two Bboxes with different confidence levels use different matching methods for data association;

[0217] First, the updated predicted trajectory is matched with the high-score detection box, and the Appearance distance and IOU distance between the target and the predicted trajectory are comprehensively considered;

[0218] The unmatched high-score detection frame is matched again with the unmatched trajectory in the previous frame, taking into account the OSPA distance and IOU distance;

[0219] The high-scoring detection frames that are successfully matched twice are set as new tracks;

[0220] For low-score detection frames, analysis shows that most of them are small targets. In order to better extract target features, they are converted to Gaussian space. The Wasserstein distance and IOU distance between Gaussian distributions are considered, and the low-score detection frames that are not successfully matched will be deleted;

[0221] At the same time, all unmatched tracks with less than 30 consecutive unmatched frames are deleted from the tracking system;

[0222] In actual operation, the number of consecutive mismatched frames can vary according to the frame rate of the input video sequence;

[0223] The successfully matched tracking estimate uses the matched detection frame to perform an update process. During the update process, the trajectory prediction of the visual target is modeled as a random finite set, and the visual VGM-PHD is used to generate the prediction information of the tracker to prepare the associated match for the next frame;

[0224] When performing data association, the detection BBox with a confidence score higher than 0.5 is added to the high-score detection BBox set, and the detection BBox with a confidence score between 0.2 and 0.5 is added to the low-score detection BBox set;

[0225] Four distance metrics are used in the proposed data association process. Based on these four distance metrics, three matching methods are designed, namely Gau-IOU distance matching, Appear-IOU and OSPA-IOU distance matching;

[0226] make Represents the i-th detected target detection BBox and the corresponding feature vector in the current frame, Represents the target BBox and corresponding feature vector predicted by the -th trajectory of the previous frame;

[0227] Calculate the first distance metric based on the IOU distance

[0228]

[0229] The IoU distance here is defined as:

[0230]

[0231] Among them, ∩ and ∪ represent the intersection and union of two regions respectively;

[0232] In order to solve the matching of low-score detection boxes and trajectories, Gau-IOU distance matching is performed, which specifically includes the following steps:

[0233] First, the BBox of the target and trajectory is converted to Gaussian space using matrix transformation;

[0234] For the target box (x, y, w, h), the parameters N(x|μ, Σ) of the Gaussian distribution are calculated as

[0235] The Gau-IOU trajectory matching process is as follows Figure 6 As shown;

[0236] μ=[x,y] T (9);

[0237]

[0238] The key to matching the detection frame with the trajectory is how to calculate the Gaussian distribution N of the detection frame d (x d |μ d ,Σ d ) and the trajectory box Gaussian distribution N t (x t |μ t ,Σ t ) between them;

[0239] Wasserstein distance is used to calculate the distance between two Gaussian distributions;

[0240]

[0241] The Wasserstein distance is mainly divided into two parts: the distance between the center points (x, y) and the coupling term about (h, w);

[0242] Since the parameters form a chain coupling relationship and influence each other, it is very conducive to high-precision matching;

[0243] In order to match the predicted trajectory with the high-score detection box, Appear-IOU distance matching is performed. Specifically, the following steps are included:

[0244] The appearance vector of the target contains a lot of appearance information. Combining it with the IOU distance of the BBox can improve the matching accuracy between the detection box and the trajectory. The process is as follows: Figure 7 As shown;

[0245] The second distance metric It is calculated based on the cosine distance between two embedded feature vectors:

[0246]

[0247] Where · represents the dot product between two vectors, ||A|| represents the 2-norm value of vector A;

[0248] In order to match the unmatched high-score detection frame with the unmatched trajectory of the previous frame, OSPA-IOU distance matching is performed. Specifically, the following steps are included:

[0249] OSPA distance allows to consider sub-pattern matching of target trajectories, which makes it possible to better capture the similarities and differences between target trajectories, thus more accurately evaluating the tracking performance. Based on IOU distance matching, OSPA distance is comprehensively considered and an OSPA-IOU trajectory matching model is proposed. The process is as follows: Figure 8 As shown;

[0250] Assume that the target state set is The target trajectory set is Represents the estimated number of targets and the actual number of targets;

[0251] The OSPA distance is expressed as

[0252]

[0253] In the formula, Π n For Select all permutations and combinations of m numbers in the set;

[0254] If p = 1, the OSPA distance can be expressed as:

[0255]

[0256] In the formula, are the position difference and potential difference between the target estimated state set and the target true state set, respectively;

[0257] The position difference reflects the actual spatial distance difference, and the potential difference reflects performance parameters such as the false track ratio, redundant track ratio, and track interruption times;

[0258] The cutoff parameter c reflects the weight between position difference and potential difference. The smaller the parameter c is, the greater the weight of position difference is.

[0259] The target is regarded as a set of single elements and the trajectory is regarded as a set of multiple elements. The best match between a single detection and a trajectory is achieved by calculating the OSPA distance between the two sets.

[0260] Visual Gaussian mixture probability hypothesis density filter VGM-PHD:

[0261] The visual GM-PHD filtering algorithm uses the center position of all trajectories as the measurement input of a random finite set, while retaining the ID and size information of the target and trajectory, which facilitates the restoration of the target trajectory;

[0262] At the same time, the following assumptions are made: (1) Both the derived target and the new target PHD can be expressed as a Gaussian mixture form; (2) the detection probability and survival probability of the target are independent of each other; (3) the state transition density function and the observation likelihood function are both linear Gaussian models;

[0263] The motion model and observation model of the VGM-PHD filtering algorithm are both set to be linear, and the noise and error obey the Gaussian distribution;

[0264] The weight, mean and variance of PHD Gaussian distribution are used to recursively transfer multi-objective states.

[0265] The specific implementation steps of the VGM-PHD filtering algorithm are as follows;

[0266] Assume that the posterior PHD at time k-1 is in the following Gaussian sum form:

[0267]

[0268] in are the weight, mean and covariance of the i-th Gaussian component at time k, x represents the state of a single target at time k, and J k Represents the number of Gaussian components at time k;

[0269] The function N(·) indicates that the variable follows a Gaussian distribution, and the prediction strength function at time k is:

[0270] T k∣k-1 (x) = T s,k∣k-1 (x)+T β,k∣k-1 (x)+γ k (x) (18);

[0271] The three terms on the right side of the equation are the predicted PHDs of the surviving target, the derived target, and the new target;

[0272] The intensity function updated by the GM-PHD filtering algorithm can be expressed as follows:

[0273]

[0274] Where, the first term represents the PHD of the missed target, and the second term represents the updated PHD of the detected target;

[0275] In the VGM-PHD filtering algorithm, if the PHD function at time k-1, the prior distribution generated by the prediction at time k, and the posterior distribution obtained by filtering and updating can all be expressed in the form of Gaussian mixture;

[0276] Its weight can be obtained by PHD filtering, and its mean and covariance can be obtained by Kalman filtering recursion;

[0277] While VGM-PHD is predicting and updating the target PHD, the number of predicted targets N k|k-1 and update target number N k They are:

[0278]

[0279] In summary, the present invention applies the Transformer architecture to multi-target tracking in drone aerial video, realizing multiple target detection and stable tracking from the perspective of drone aerial photography. The advantages are:

[0280] (1) Based on the Transformer architecture, the Holistic Transformer is designed to capture both local and global interactive information of the target. Global information helps to understand the overall dynamics of the scene, while local information can improve the recognition and tracking of small targets.

[0281] (2) An anchor-free detection head is used to generate more accurate target detection information, which provides the necessary basis for multi-target trajectory tracking in UAV aerial videos with crowded and small target scenes;

[0282] (3) The introduced GM-PHD method based on visual detection results can accurately predict the target motion trajectory and achieve continuous and stable tracking in UAV aerial videos, especially when the target moves fast or the scene changes frequently;

[0283] (4) The designed GAO trajectory matching mechanism comprehensively considers multiple factors such as Gaussian distance, Appearance distance, OSPA distance and IOU distance, which improves the robustness of the multi-target tracking model and can better cope with challenges in complex scenes such as target occlusion and cross-movement.

[0284] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for tracking multiple targets of unmanned aerial vehicles based on computer vision, which is implemented based on a multi-target tracking system for unmanned aerial vehicle photography. The multi-target tracking system for unmanned aerial vehicle photography consists of a Holistic Trans-Detector module and a GAO-Trajectory Matching Pattern trajectory association module, and is characterized in that: The following steps are involved: S1.Holistic Trans-Detector target detection and feature extraction, establish Holistic self-attention mechanism, and design Anchor-Free prediction head; S2.GAO trajectory matching mechanism, performing Gau-IOU distance matching, Appear-IOU distance matching and OSPA-IOU distance matching; S3. Visual Gaussian Mixture Probability Hypothesis Density Filter VGM-PHD.

2. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 1, characterized in that: The specific implementation steps of step S1 Holistic Trans-Detector target detection and feature extraction are as follows: To adapt to high-resolution visual tasks, high-resolution feature maps can be obtained at an early stage; The entire model adopts a hierarchical design, which consists of 4 stages. Each stage reduces the resolution of the input feature map and expands the receptive field layer by layer like CNN. At the beginning of the input, a Patch Embedding is made to cut the image into tiles and embed them into the Embedding. In each stage, it consists of multiple Holistic Transformer Layers; The specific structure of Holistic Transformer Layer is mainly composed of Layer Norm, MLP, and Holistic Attention; The image with resolution H×W×3 is first divided into blocks of size 4×4, and the Then use a convolutional layer with a kernel size and stride of 4 to project these patches into features of dimension d; Given this spatial feature map, pass it to a four-stage cascade of Holistic Transformer layers; At each stage, the Holistic Transformer block consists of 2, 2, 18, and 2 Holistic Transformer layers, respectively; After each stage, a Patch Embedding layer is added to reduce the spatial size of the feature map by 2 times while increasing the feature dimension by 2 times; Finally, the feature maps of all four stages are sent to the detector head, and the appearance feature vector of the target is output at the same time for matching of multi-target trajectories.

3. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 2, characterized in that: The specific implementation steps of step S1 to establish the Holistic self-attention mechanism are as follows: In a space of size M×N, x∈R M×N×d The feature map is first divided into 4×4 partitions, and each 4×4 partition is used as the feature perception core to perform attention perception from the surrounding ranges of different granularities; Then, find the surroundings for each window; Assume that the input feature map x∈R M×N×d , where M×N is the spatial dimension and d is the feature dimension; The feature map is pooled in parallel with three levels of sub-windows l∈{1,2,4}. First, the input feature map x is divided into a sub-window grid of size l×l, and then a linear layer is used Pooling is performed in the spatial sub-window in the following way, see formula (1): in, The pooled feature maps at different levels l provide rich fine-grained and coarse-grained information; Attention calculation; After obtaining the pooled feature maps of all levels, three linear projection layers f are used q ,f k and f v Calculate the query of the first layer and the keys and values ​​of all layers, see equations (2), (3) and (4): Q=f q (x 1 ) (2); K l =f k (x l ) (3); V l =f v (x l ) (4); To perform holistic self-attention, you first need to extract the surrounding tokens for each query token in the feature map; For the i-th window queries within, from the K surrounding the window l and V l Extract l×l keys and values ​​from i ∈R s×d and V i ∈R s×d , where s is the sum of the holistic regions from all levels, i.e. s = 8×8+6×6+5×5; Finally, Q is calculated by i Holistic self-attention, see formula (5): In the formula, B={B l } is the learnable relative position bias; For the first layer, it is parameterized as B 1 ∈R 7×7 For other holistic levels, considering that they have different granularity for queries, all queries within the window are treated equally and used To represent the query window and each pooled The relative position deviation between tokens; Since the holistic self-attention of each window is independent of other windows, the attention can be calculated in parallel.

4. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 3, characterized in that: The specific implementation steps of step S1 to design the Anchor-Free prediction head are as follows: Design the Anchor-Free prediction head based on the CenterNet architecture and divide it into detection branch and appearance branch; Feature extraction is performed through the Holistic Transformer, and the output feature map is provided to the two branches for object detection and appearance embedding; The detection branch consists of three heads, which are used to predict the heat map, the center point offset of the object, and the size of the object; The heat map head is used to predict the center position of the target, and its output dimension is h×w×Cls, where h and w are the height and width of the input feature map, respectively, and Cls is the number of all detection classes; Each class has its own heatmap output, and each Gaussian peak in the heatmap represents the center position of the detected object; Assume that there are N targets in the current training sample; make represents the center position of the i-th target in i∈[1,N]; Then, calculate the heat map corresponding to the current training sample, see formula (6): In the formula, the operator Returns the integer a that is closest to a and smaller than σ c is the standard deviation parameter; M∈R h×w×Cls Represents the output of the heat map head, M xy as the value at position (x,y); The box size and center offset heads are used to predict the BBox of the target and the offset of the target center point respectively; Will represents the BBox of the i-th target, and Respectively represent the upper left and lower right coordinates of the target; At the same time, the center offset of the i-th target is defined as shown in formula (7); Will is represented as the output of the center offset head, and Expressed as The offset prediction of the i-th target at position (x, y) helps to improve the accuracy of the predicted target center position; The appearance branch is responsible for generating embedded features that help identify objects. Each head consists of a 3×3 convolutional layer with 256 channels, followed by a 1×1 convolutional layer to produce the final output. The appearance feature vector of the target is calculated using the embedding head of the appearance branch, which is used for the association matching operation in the multi-target tracking task; Specifically, these appearance feature vectors are used for associative matching to compute the similarity between the tracker and the detected object; In the formula, the 128-dimensional vector at the (x, y) position represents the appearance feature vector of the target at that position.

5. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 4, characterized in that: The specific implementation steps of step S2 GAO trajectory matching mechanism are as follows: The GAO track matching mechanism considers detection confidence, appearance embedding distance and IoU distance, and associates all tracking tracks with all detection Bboxes; When the detection result output by the detector is received, the detected Bbox is divided into high-score detection boxes and low-score detection boxes according to the prediction confidence; Next, these two Bboxes with different confidence levels use different matching methods for data association; First, the updated predicted trajectory is matched with the high-score detection box, and the Appearance distance and IOU distance between the target and the predicted trajectory are comprehensively considered; The unmatched high-score detection frame is matched again with the unmatched trajectory in the previous frame, taking into account the OSPA distance and IOU distance; The high-scoring detection frames that are successfully matched twice are set as new tracks; For low-score detection frames, analysis shows that most of them are small targets. In order to better extract target features, they are converted to Gaussian space. The Wasserstein distance and IOU distance between Gaussian distributions are considered, and the low-score detection frames that are not successfully matched will be deleted; At the same time, all unmatched tracks with less than 30 consecutive unmatched frames are deleted from the tracking system; In actual operation, the number of consecutive mismatched frames can vary according to the frame rate of the input video sequence; The successfully matched tracking estimate uses the matched detection frame to perform an update process. During the update process, the trajectory prediction of the visual target is modeled as a random finite set, and the visual Gaussian mixture probability hypothesis density filter (VGM-PHD) is used to generate the tracker's prediction information to prepare the associated match for the next frame; When performing data association, the detection BBox with a confidence score higher than 0.5 is added to the high-score detection BBox set, and the detection BBox with a confidence score between 0.2 and 0.5 is added to the low-score detection BBox set; Four distance metrics are used in the proposed data association process. Based on these four distance metrics, three matching methods are designed, namely Gau-IOU distance matching, Appear-IOU and OSPA-IOU distance matching; make Represents the i-th detected target detection BBox and the corresponding feature vector in the current frame, Represents the target BBox and corresponding feature vector predicted by the -th trajectory of the previous frame; Calculate the first distance metric based on the IOU distance Here the IoU distance is defined as follows: Where ∩ and ∪ represent the intersection and union of two regions, respectively.

6. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 5, characterized in that: The specific implementation steps of the step S2 for performing Gau-IOU distance matching are as follows: Convert the BBox of the target and trajectory to Gaussian space by matrix transformation; For the target box (x, y, w, h), the parameters N(x|μ,Σ) of the Gaussian distribution are calculated as Gau-IOU trajectory matching, see equations (9) and (10); μ=[x,y] T (9); The key to matching the detection box with the trajectory is how to calculate the Gaussian distribution N of the detection box. d (x d |μ d ,Σ d ) and the trajectory box Gaussian distribution N t (x t |μ t ,Σ t ) between them; The Wasserstein distance is used to calculate the distance between two Gaussian distributions, see formula (11); The Wasserstein distance is mainly divided into two parts: the distance between the center points (x, y) and the coupling term about (h, w); Since the parameters form a chain coupling relationship and influence each other, it is very conducive to high-precision matching.

7. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 6, characterized in that: The specific implementation steps of step S2 Appear-IOU distance matching are as follows: The appearance vector of the target contains a lot of appearance information, which is combined with the IOU distance of the BBox to improve the matching accuracy between the detection box and the trajectory; The second distance metric It is calculated based on the cosine distance between two embedded feature vectors, see formula (12): Here, "·" represents the dot product between two vectors, and ||A|| represents the 2-norm value of vector A.

8. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 7, characterized in that: The specific implementation steps of step S2 OSPA-IOU distance matching are as follows: OSPA distance allows considering sub-pattern matching of target trajectories, so that it can better capture the similarities and differences between target trajectories, thereby more accurately evaluating the tracking performance. Based on IOU distance matching, OSPA distance is comprehensively considered and an OSPA-IOU trajectory matching model is proposed. Assume that the target state set is X = {x1,x1,··,x m }, the target trajectory set is Y = {y1,y1,··,y n }, Represents the estimated number of targets and the actual number of targets; The OSPA distance is expressed as formula (13); In the formula, Π n To select all permutations and combinations of m numbers from the set {1,2,…,n}; If p = 1, the OSPA distance can be expressed as (14), (15) and (16): In the formula, are the position difference and potential difference between the target estimated state set and the target true state set, respectively; The position difference reflects the actual spatial distance difference, and the potential difference reflects the performance parameters of false track ratio, redundant track ratio, and track interruption number; The cutoff parameter c reflects the weight between position difference and potential difference. The smaller the parameter c is, the greater the weight of position difference is. The target is regarded as a set of single elements and the trajectory is regarded as a set of multiple elements. The best matching of single detection and trajectory is achieved by calculating the OSPA distance between the two sets.

9. The method for tracking multiple targets of unmanned aerial vehicles based on computer vision according to claim 8, characterized in that: The specific implementation steps of step S3 are as follows: The visual GM-PHD filtering algorithm uses the center position of all trajectories as the measurement input of a random finite set, while retaining the ID and size information of the target and trajectory, which facilitates the restoration of the target trajectory; At the same time, the following assumptions are made: the PHD of both the derived and new targets can be expressed as Gaussian mixture forms, the detection probability and survival probability of the target are independent of each other, and the state transition density function and observation likelihood function are both linear Gaussian models; The motion model and observation model of the VGM-PHD filtering algorithm are both set to linear, and the noise and error obey Gaussian distribution; The weight, mean and variance of PHD Gaussian distribution are used to recursively transfer multi-objective states. The specific implementation steps of the VGM-PHD filtering algorithm are: Assume that the posterior PHD at time k-1 is in the following Gaussian sum form: in are the weight, mean and covariance of the i-th Gaussian component at time k, x represents the state of a single target at time k, and J k Represents the number of Gaussian components at time k; The function N(·) indicates that the variable follows a Gaussian distribution. The prediction strength function at time k is shown in (18): T k∣k-1 (x)=T s,k∣k-1 (x)+T β,k∣k-1 (x)+γ k (x) (18); The three terms on the right side of the formula are the predicted PHDs of the surviving target, the derived target, and the new target; The intensity function updated by the GM-PHD filtering algorithm can be expressed as formula (19): Where, the first term represents the PHD of the missed target, and the second term represents the updated PHD of the detected target; In the VGM-PHD filtering algorithm, if the PHD function at time k-1, the prior distribution generated by the prediction at time k, and the posterior distribution obtained by filtering and updating can all be expressed in the form of Gaussian mixture; Its weight can be obtained by PHD filtering, and its mean and covariance can be obtained by Kalman filtering recursion; While VGM-PHD is predicting and updating the target PHD, the number of predicted targets N k|k-1 and update target number N k , see equations (20) and (21):