Unmanned aerial vehicle visual angle small target tracking method based on LSTM-KF
By using the LSTM-KF method from the perspective of a drone, combined with slicing technology and an improved attention mechanism network, the problem of small target detection and tracking under the view of a mobile drone is solved, improving detection accuracy and tracking stability, and reducing the number of switching times.
Patent Information
- Application Number
- CN202410836714.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the view of a mobile drone, there are difficulties in multi-target tracking, especially small target detection accuracy is low, tracking is difficult, and switching times are high. It is difficult to use the traditional Kalman filter to effectively model, and high-resolution image downsampling results in Target lost.
A UAV perspective small target tracking method based on LSTM-KF is used to segment the picture through slicing technology, integrate the CSPDarknet network with the improved CBAM attention mechanism for feature extraction, and use the joint loss function to train the model, combining LSTM and Kalman filtering Perform motion estimation and state estimation.
It improves the detection accuracy and tracking accuracy of small targets from the perspective of the drone, reduces the difficulty of target tracking and the number of switching times, and achieves faster network convergence and better positioning results.
Smart Images

Figure CN118644524A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of target detection and target tracking, and in particular to a method for tracking small targets from a drone's perspective based on LSTM-KF. Background Art
[0002] Multi-object tracking is a fundamental task in computer vision and is widely used in many applications such as autonomous driving, intelligent transportation systems, and advanced video analytics. Multi-object tracking methods usually follow the detection-tracking paradigm, which consists of two steps: detection and data association. The detection step generates latent box predictions of the target objects in each frame, while the data association step matches the predicted boxes of the same object across frames based on appearance and motion cues. In recent years, due to the convenience and dexterity of drones, multi-object tracking under the view of drones has aroused great interest among researchers.
[0003] Despite the progress made in traditional multi-target tracking (usually tested on videos captured in static view), multi-target tracking in the view of moving drones remains challenging. In the detection stage, there are usually multiple classes of targets in the field of view of moving drones, and the number of each class of targets is extremely unbalanced, which makes it difficult to train the detection model. In addition, due to the high altitude of drones, most objects in drone videos are small, and the detection accuracy of targets is low due to the small amount of information and lack of appearance features, which further increases the difficulty of the detection task. In the data association stage, the challenge lies in the inconsistency between the appearance and motion information of the target objects, which is caused by irregular and fast camera motion, and usually leads to ID switching. The target motion in drone videos is the superposition of the target motion and the drone's own motion, which is irregular. Small targets have low detection accuracy, high tracking difficulty and high switching times, which are difficult to model with traditional Kalman filters. Summary of the invention
[0004] This application provides a small target tracking method from the perspective of a drone based on LSTM-KF, the technical purpose of which is to improve the small target detection accuracy from the perspective of the drone, reduce the difficulty of target tracking, and reduce the number of switching times.
[0005] The above technical objectives of this application are achieved through the following technical solutions:
[0006] A small target tracking method from the perspective of a UAV based on LSTM-KF, comprising:
[0007] Step S1: Evenly divide the image into M×N small images by slicing technology;
[0008] Step S2: Input the small image into the feature extraction network for feature extraction, and then classify and locate it after feature extraction to obtain the recognition result; wherein, the feature extraction network includes a CSPDarknet network that incorporates the improved CBAM attention mechanism;
[0009] Step S3: training the deep learning network by combining the loss function and the recognition result to obtain the best detection network weight, thereby obtaining a target detection model, and detecting the target through the target detection model;
[0010] Step S4: Use the LSTM-KF model to perform motion estimation on the target detected by the target detection model to achieve small target tracking.
[0011] The beneficial effects of this application are as follows: the LSTM-KF-based small target tracking method from the perspective of a drone described in this application first slices and segments the input drone aerial image frame by frame, effectively solving the problem of target loss in the downsampling process of high-resolution images; secondly, the segmented small image set is passed into the detection network that incorporates the improved attention mechanism to improve the network's feature extraction capability; then the network model is trained using a joint loss function to achieve faster convergence speed and better positioning results; finally, the LSTM-KF algorithm is used to extract motion features and estimate the state of the detected target to achieve more accurate small target matching and tracking. Compared with existing multi-target tracking methods, this tracking method has higher accuracy and obvious advantages in position detection, motion estimation, and real-time tracking of small targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a flow chart of a small target tracking method from a drone perspective based on LSTM-KF in an embodiment of the present application;
[0013] Figure 2 This is a schematic diagram of the slicing technology in the embodiment of this application;
[0014] Figure 3 This is the Res_CBAM attention structure diagram in the embodiment of this application;
[0015] Figure 4 This is a schematic diagram of the LSTM-KF model in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The technical solution of the present application will be described in detail below in conjunction with the accompanying drawings. It should be understood that the following specific implementation methods are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0017] like Figure 1 As shown, the small target tracking method based on LSTM-KF from the perspective of a UAV described in this application includes:
[0018] Step S1: Use slicing technology to evenly divide the image into M×N small image sets I m*n After segmentation and cropping, the pixel area containing the target may be cut off, so an overlap image I with a pre-set overlap ratio is added at the segmentation line. mix . Each picture I j All of them will be sent to the detection model to perform the detection task, generate anchor boxes and perform non-maximum suppression, and then send the small image I{1,2,...,m*n,I mix}Synthesize the original image, such as Figure 2 shown.
[0019] Specifically, for a drone aerial image, assuming the resolution is 3840*2560, after CSPDarknet downsampling 5 times, a lot of data information has been lost. The image is segmented using the slicing technology in step S1, divided into 6×4 small picture sets, and the overlap rate is set to 0.2. Then the resolution of each small picture is 640×640, and the resolution of the overlapping area is 640×128. The preprocessed picture set will be used as the input I of the target detection model. 6*4
[0020] Step S2: Input the small image into the feature extraction network for feature extraction, and then classify and locate it after feature extraction to obtain the recognition result; wherein, the feature extraction network includes the CSPDarknet network that incorporates the improved CBAM attention mechanism.
[0021] The feature extraction network uses the CSPDarknet network that incorporates the Res_CBAM attention mechanism. The CBAM attention mechanism consists of two independent sub-modules: channel attention and spatial attention. It uses two dimensions of attention to extract features more comprehensively. For small target detection scenarios, complex background noise and small-sized foreground, the CBAM module is embedded in the residual module. The residual module connects the input feature map with the feature map after channel attention and spatial attention operations to supplement the features lost in the maximum pooling and global average pooling processes. After the small image is input into the feature extraction network, such as Figure 3 As shown, in the CBAM module, attention heatmap inference is performed on the given intermediate feature map along the channel and spatial dimensions, and then the attention heatmap is multiplied with the feature map to perform adaptive feature refinement.
[0022] Channel attention uses the feature relationship between different channels to generate a mapping. First, the spatial information of the feature map is aggregated by using both average pooling AvgPool and maximum pooling MaxPool operations. Then the aggregated information is passed to a multi-layer perceptron with a hidden layer. The output after calculation is:
[0023] Mc (F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F)));
[0024] Among them, δ is the sigmoid function.
[0025] Spatial attention uses average pooling and maximum pooling operations to aggregate the channel information of the feature map to generate two 2D maps, which are then connected and convolved by a 7×7 standard convolutional layer to produce a 2D spatial attention map. The calculation result is:
[0026] M s (F) = σ(f 7×7 ([AvgPool(F); MaxPool(F)]))
[0027] Finally, the output feature map after channel attention and spatial attention is connected to the original input feature map to achieve semantic fusion of multi-layer context in the form of a residual network.
[0028] The CSPDarknet network consists of a Focus structure, a convolution module Conv, a feature extraction module CBL, and a spatial pyramid pooling module SPPF. The Focus structure slices the original 680*680*3 image into a 340*340*12 feature map, which is then convolved with 32 convolution kernels to finally become a 340*340*12 feature map. The feature extraction module CBL is the most basic joint module, consisting of a convolution layer, a normalization layer, and a Leaky Relu activation layer. The CBL module first divides the feature map of the base layer into two parts, and then merges them through a cross-stage hierarchy, which can reduce the amount of calculation while ensuring accuracy. The spatial pyramid pooling module SPPF concats feature maps of different scales through multiple 5*5 MaxPool2d operations. This method integrates the Res_CBAM attention mechanism before the spatial pyramid pooling module SPPF of the CSPDarknet network for feature enhancement.
[0029] Step S3: The deep learning network is trained by combining the loss function and the recognition result to obtain the best detection network weight, thereby obtaining a target detection model, and the target is detected by the target detection model.
[0030] The EIOU loss and NWD loss are weighted and used as the loss function to train the model. The expression function of EIOU is:
[0031]
[0032] Among them, L EIoU represents the loss of the EIOU loss function, LIoU represents the overlap loss, L dis represents the center distance loss, L asp represents the width and height loss, b and b gt They represent the center point of the predicted box and the center point of the actual box respectively, c represents the diagonal length of the minimum bounding rectangle that can contain both the predicted box and the real box, and c w and c h Represents the width and height of the smallest outer rectangle of the predicted box and the actual box, respectively. w and h represent the width and height of the predicted box, respectively. gt and h gt represent the width and height of the actual box, respectively, and ρ represents b and b gt Between, w and w gt Between, h and h gt The Euclidean distance between .
[0033] The expression function of Gaussian Wasserstein distance is:
[0034]
[0035] Among them, N a and N b Represent the real box and the predicted box respectively; (cx a ,cy a ) represents the coordinates of the center point of the anchor box, w and h represent the width and height of the anchor box respectively, and ||·|| represents the Frobenius norm.
[0036] It is a distance indicator and cannot be directly used as a similarity measure. Its exponential form is normalized to obtain a new metric NWD, which is expressed as:
[0037]
[0038] Where C represents a constant set according to the data set.
[0039] By combining EIOU and NWD as the loss function of the target detection model, the joint loss function is expressed as:
[0040] Loss=iou_ratio*L EIoU +(1-iou_ratio)*NWD;
[0041] Among them, iou_ratio represents the set proportional weight.
[0042] Step S4: Use the LSTM-KF model to perform motion estimation on the target detected by the target detection model to achieve small target tracking.
[0043] Specifically, after obtaining the trained detection model, the input video is preprocessed and inferred frame by frame, and the motion estimation algorithm LSTM-KF combining LSTM and Kalman filtering is used, such as Figure 4 As shown in the figure, the position and speed of the detected target are accurately estimated. First, the coordinate and speed input data are preprocessed and then input into the LSTM model for prediction. Output average speed prediction Combined with the filtered speed, the average speed prediction is used to calculate the coordinate prediction; the output instantaneous speed prediction v p,k|k-1 Combined with the filtered speed, the speed prediction is obtained. Finally, the coordinate prediction and speed prediction are combined with the current measurement to obtain the final state estimate and speed estimate.
[0044] Step S4 specifically includes:
[0045] Step S41: preprocessing the coordinate data and speed data of the target detected by the target detection model, including:
[0046] Let the target motion trajectory length be N, then L i 1:N ={c r,k , k=1,2,...N} represents the real coordinate set of the i-th trajectory in the velocity concentration, V i 1:N = {v r,k , k=1,2,...N} represents the true velocity set of the i-th trajectory; where c r,k and v r,k Respectively represent the real coordinates and real speed of the target trajectory;
[0047] Use a sliding window to extract the real coordinate set L of the trajectory i 1:N Extract the length W L The coordinate data of , we get:
[0048] I L,j ={c r,k ,k=j,j+1...,W L +j-1};
[0049] The coordinate data is converted into average velocity by difference processing, which is expressed as:
[0050]
[0051] When predicting the average speed, the instantaneous speed is also used as input to add one-dimensional information to improve the prediction accuracy. The j-th input vector of the LSTM model predicting the average speed is expressed as:
[0052]
[0053] Among them, the corresponding label of the j-th input vector of the predicted average speed is
[0054] Use a sliding window to extract the true velocity set V i 1:N Extract the length W v The j-th input vector of the LSTM model for predicting instantaneous speed is expressed as:
[0055] I v,j = {v r,k ,k=j,j+1,...,W v +j-1};
[0056] Among them, the corresponding label of the jth input vector for predicting instantaneous speed is
[0057] Normalize the corresponding labels of the input vectors of the predicted average speed and the predicted instantaneous speed to obtain:
[0058]
[0059]
[0060] Step S42: Input the corresponding labels of the normalized input vectors of the predicted average speed and the predicted instantaneous speed into the LSTM model for training, perform back propagation on the LSTM model, and update the network parameters and weights until the model converges. When the LSTM model output minimizes the root mean square error, the training of the LSTM model is completed, and the trained LSTM model is obtained; wherein, the loss functions of the predicted average speed and the predicted instantaneous speed in the LSTM model are respectively expressed as:
[0061]
[0062]
[0063] Among them, L1 represents the loss function for predicting the average speed; L2 represents the loss function for predicting the instantaneous speed.
[0064] Step S43: The average speed and instantaneous speed of the target are predicted and output by the trained LSTM model, and the predicted average speed and instantaneous speed are denormalized to obtain the average speed prediction. and instantaneous speed prediction v p,k|k-1 .
[0065] Step S44: Predicting by average speed Estimate the velocity v at the previous moment f,k-1Adjust the coordinates at time k and predict c using the KF algorithm p,k Calculate and express it as:
[0066]
[0067] Among them, U(·) indicates the execution of KF algorithm;
[0068] Predict v by instantaneous velocity p,k|k-1 Estimate the velocity v at the previous moment f,k-1 Adjust the speed v at time k by KF algorithm p,k Calculate and express it as:
[0069] v p,k =U(v p,k|k-1 ,v f,k-1 );
[0070] The KF algorithm is used to combine the coordinate prediction and velocity prediction at time k with the measured coordinates and velocity at time k to obtain the final coordinate estimate and final velocity estimate at time k, which are expressed as:
[0071] c f,k =U(c p,k ,c m ,k);
[0072] v f,k =U(v p ,k,v m ,k).
[0073] Step S45: Repeat steps S41 to S44 to achieve continuous tracking of the target.
[0074] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.
Claims
1. A small target tracking method from the perspective of a UAV based on LSTM-KF, characterized in that: include: Step S1: Evenly divide the image into M×N small images by slicing technology; Step S2: Input the small image into the feature extraction network for feature extraction, and then classify and locate the features to obtain the recognition result; wherein the feature extraction network includes the CSPDarknet network incorporating the improved CBAM attention mechanism; Step S3: training the deep learning network by combining the loss function and the recognition result to obtain the best detection network weight, thereby obtaining a target detection model, and detecting the target through the target detection model; Step S4: Use the LSTM-KF model to perform motion estimation on the target detected by the target detection model to achieve small target tracking.
2. The method for tracking small targets from the perspective of an unmanned aerial vehicle according to claim 1, characterized in that: In step S1, overlapping images with a pre-set overlapping ratio are added to the image at the segmentation point.
3. The method for tracking small targets from the perspective of an unmanned aerial vehicle according to claim 1, characterized in that: In step S2, the improved CBAM attention mechanism is embedded in the residual module, and it includes a channel attention module and a spatial attention module; The CSPDarknet network includes a Focus structure, a convolution module, a feature extraction module and a spatial pyramid pooling module. The feature extraction module includes a convolution layer, a normalization layer and an activation layer. The activation layer uses a Leaky Relu (Leaky Rectified Linear Unit) activation function.
4. The method for tracking small targets from the perspective of an unmanned aerial vehicle according to claim 1, characterized in that: In step S3, the joint loss function is expressed as: Loss=iou_ratio*L EIoU +(1-iou_ratio)*NWD; Among them, iou_ratio represents the set proportional weight; Among them, L EIoU represents the loss of the EIOU loss function, L IoU represents the overlap loss, L dis represents the center distance loss, L asp represents the width and height loss, b and b gt They represent the center point of the predicted box and the center point of the actual box respectively, c represents the diagonal length of the minimum bounding rectangle that can contain both the predicted box and the real box, and c w and c h Represents the width and height of the smallest outer rectangle of the predicted box and the actual box, respectively. w and h represent the width and height of the predicted box, respectively. gt and h gt represent the width and height of the actual box, respectively, and ρ represents b and b gt Between, w and w gt Between, h and h gt The Euclidean distance between Wherein, NWD represents the NWD loss function; is a distance indicator, indicating the Gaussian Wasserstein distance; N a and N b Represent the real box and the predicted box respectively; (cx a ,cy a ) represents the coordinates of the center point of the anchor box, w and h represent the width and height of the anchor box respectively, ||·|| represents the Frobenius norm; C represents a constant set according to the dataset.
5. The method for tracking small targets from the perspective of an unmanned aerial vehicle according to claim 1, characterized in that: Step S4 includes: Step S41: preprocessing the coordinate data and speed data of the target detected by the target detection model, including: Let the target motion trajectory length be N, then L i 1:N ={c r,k , k=1,2,...N} represents the real coordinate set of the i-th trajectory in the velocity concentration, V i 1:N = {v r,k , k=1,2,...N} represents the true velocity set of the i-th trajectory; where c r,k and v r,k Respectively represent the real coordinates and real speed of the target trajectory; Use a sliding window to extract the real coordinate set L of the trajectory i 1: N Extract the length W L The coordinate data of , we get: I L,j ={c r,k ,k=j,j+1...,W L +j-1}; The coordinate data is converted into average velocity by difference processing, which is expressed as: When predicting the average speed, the instantaneous speed is also used as input to add one-dimensional information. The j-th input vector of the LSTM model predicting the average speed is expressed as: Among them, the corresponding label of the j-th input vector of the predicted average speed is Use a sliding window to extract the true velocity set V i 1: N Extract the length W v The j-th input vector of the LSTM model for predicting instantaneous speed is expressed as: I v,j ={v r,k ,k=j,j+1,...,W v +j-1}; Among them, the corresponding label of the jth input vector for predicting instantaneous speed is Normalize the corresponding labels of the input vectors of the predicted average speed and the predicted instantaneous speed to obtain: Step S42: Input the corresponding labels of the normalized input vectors of the predicted average speed and the predicted instantaneous speed into the LSTM model for training. When the LSTM model output minimizes the root mean square error, the training of the LSTM model is completed to obtain the trained LSTM model; wherein the loss functions of the predicted average speed and the predicted instantaneous speed in the LSTM model are respectively expressed as: Among them, L1 represents the loss function of predicting average speed; L2 represents the loss function of predicting instantaneous speed; Step S43: The average speed and instantaneous speed of the target are predicted and output by the trained LSTM model, and the predicted average speed and instantaneous speed are denormalized to obtain the average speed prediction. and instantaneous velocity prediction vp,k | k-1; Step S44: Predicting by average speed Estimate the velocity v at the previous moment f,k-1 Adjust the coordinates at time k and predict c using the KF algorithm p,k Calculate and express it as: Among them, U(·) indicates the execution of KF algorithm; Predict v by instantaneous velocity p,k|k-1 Estimate the velocity v at the previous moment f,k-1 Adjust the speed v at time k by KF algorithm p,k Calculate and express it as: v p,k =U(v p,k|k-1 ,v f,k-1 ); The KF algorithm is used to combine the coordinate prediction and velocity prediction at time k with the measured coordinates and velocity at time k to obtain the final coordinate estimate and final velocity estimate at time k, which are expressed as: c f,k =U(c p,k ,c m ,k); v f,k =U(v p ,k,v m ,k); Step S45: Repeat steps S41 to S44 to achieve continuous tracking of the target.
Citation Information
Patent Citations
Unmanned aerial vehicle aerial image target detection method based on improved YOLO V5
CN113807464A
Remote sensing target quadrilateral frame rapid detection method based on deep learning
CN114299011A
Method and system for detecting small impact crater on surface of extraterrestrial celestial body, storage medium and equipment
CN117314840A
Fish disease early warning method and system
CN117611380A
Kubernetes cluster resource dynamic adjustment method and electronic device
WO2022016808A1
Cited By
Unmanned aerial vehicle position prediction method and system based on trusted UKF-BiLSTM
CN119474709A
LSTM-KF hybrid tracking method based on parameter adaptation
CN120912647A
Intelligent detection method and system for floating objects in low-altitude open scene
CN122695549A
