Keywords

1 Introduction

Relying on the flexibility of UAV with the fast and low-cost remote sensing of the high-definition cameras on board, UAVs have achieved a wide application in the field of military and civil aviation remote sensing, communication relay, and so on. In the aspect of moving target tracking by UAV, the existing autonomous tracking of the single moving target has been extensively studied and applied [1]. However, as to the problem of multiple moving target tracking, the UAV operation still relies on operator’s observing to control the UAV flight, and the autonomous flight path design has not been realized. Therefore, this paper combines the tracking, prediction, and path planning of single moving target by UAV, so as to realize UAV autonomous path planning for multiple targets. In order to achieve long-term and large-scale UAV autonomous tracking of multiple moving targets, this paper presents a solution. There are N moving targets to be tracked, and a drone starts from a point to reach the positions of these targets. After each target is visited once, the drone will return to the starting point. The UAV path problem [2] means how to find the shortest path. To realize the UAV autonomous path planning, this paper divides the scheme into three steps.

The first step is to obtain the specific motion equation of the selected moving targets. Because of the continuous relative movement of the drone and the targets, the target’s position will constantly change. To obtain the motion equation of the targets, this paper adopts the method of target tracking. Correlation filter method is widely used in the field of target tracking, due to its speed and accuracy, such as the KCF algorithm proposed by Henriques [3]. KCF constructs a training sample of a circulant matrix structure and transforms the solution of the problem into a discrete Fourier domain, avoiding the process of matrix inversion, reducing the complexity of the algorithm, and improving the tracking real-time performance. Therefore, the target position can be effectively updated by the KCF algorithm.

The second step is to predict the positions of moving targets. Because the position of a target is constantly changing, tracking its present position will lead to longer tracking time. Therefore, this paper uses the method of estimating the target position to optimize the UAV path. Due to the state change and uncertainty of moving targets, Kalman filtering method [4] is used in this paper. Kalman filtering method is a time-domain method which solves the problem based on state space. It has high applicability to the estimation of moving targets that frequently change motion states, thus becoming a universal machine learning method.

The last step is to use predicted positions to plan the UAV path, which means to quickly and accurately design a non-repeating shortest path after obtaining the positions of the targets. This problem is called the traveling salesman problem (TSP) in the unified research [5]. Due to the complexity of TSP, the time complexity of the exact solution method is long. Therefore, ant colony algorithm is adopted instead of the exact algorithm. The basic principle of ant colony algorithm uses pheromone to control the direction of ant’s movement and autonomously and effectively approach the optimal path ultimately [6]. Then, Stutzle [7] proposed the maximum and minimum ant colony algorithm. Only the pheromone of the ant with the optimal algorithm is updated; thus, the convergence speed of the algorithm is improved. Li [8] uses prior knowledge to limit the increment of pheromone and increase the road weight factor to effectively avoid the stagnation of the algorithm. Therefore, this paper combines the improved methods of scholars to optimize the ant colony algorithm and thus solves the problem of long solution time and falling into the local optimum in the route plan using ant colony algorithm.

In general, to solve the problem of UAV autonomous flight path planning, this paper presents a solution. First, the KCF algorithm is used to track multiple moving targets to obtain the position and motion information of multiple moving targets. Then, the Kalman filter method is used to predict the positions of the moving targets. Finally, the improved ant colony algorithm is used to process the acquired information to design a shortest UAV flight path to track multiple moving targets.

The scheme can realize the near-optimal drone flight path by means of computer vision under the scene of UAV multiple moving targets tracking, thereby reducing manual operations and improving the UAV autonomous flying capability.

2 Algorithm Implementation

2.1 Overall Algorithm Flow

This paper presents an algorithmic process for UAV autonomous planning. Firstly, the targets to be tracked are selected on the video sequence returned by the drone. Then, the tracking algorithm is used to obtain the positions and state changes of the moving targets, and the positions of the targets after a certain period of time are estimated according to the position changes. After obtaining the estimated motion states, the present path is optimized based on the present UAV path setting and the motion estimation of the moving targets using the ant colony algorithm. Finally, when the drone performs the calculated path flight, it updates the positions of the targets and the path in real time to achieve the UAV path planning requirement for multiple moving targets. The specific flowchart is shown in Fig. 1.

Fig. 1.
figure 1

Flowchart of the algorithmic process

2.2 Target Tracking Algorithm

The KCF tracking algorithm completes target tracking by designing a ridge regression classifier. The purpose of training the ridge regression classifier is to find a function \( f(x) = w^{T} x \) to obtain the minimum loss function:

$$ \mathop {\hbox{min} }\limits_{w} \sum\limits_{i} {(f(x_{i} - y_{i} )^{2} + \lambda \left\| w \right\|^{2} )} $$
(1)

where \( x = (x_{1} ,x_{2} , \ldots ,x_{n} ) \) represents a sample of the tracking model, \( \lambda \) represents a regular term which prevents over-fitting, and \( w \) represents a solution parameter. Solve the above equation and obtain:

$$ w = (X^{T} X + \lambda I)^{ - 1} X^{T} y $$
(2)

where \( X \) is the cyclic matrix, and \( y \) is a set of tag values for each sample. For samples that cannot be classified in the original space, the kernel function is needed to map the linearly inseparable patterns in the low-dimensional space to the high-dimensional space. The format of the kernel function is as follows:

$$ k(x,z) = \varphi (x)\varphi (z) $$
(3)

where \( k(x,z) \) is the kernel function, and \( \varphi (x) \) and \( \varphi (z) \) are mapping functions from low-dimensional space to high-dimensional space. When the kernel function is used to map the sample \( x \) to \( \varphi (x) \), in \( f(x) = w^{T} x \), the coefficient \( w \) is converted into \( a \) in the dual space. Combine with the above formula and obtain:

$$ a = (K + \lambda I)^{ - 1} y $$
(4)

where \( K \) represents the mapped kernel matrix, \( K_{ij} = k(x_{i} ,x_{j} ) \). In the tracking phase, dense sampling is performed near the targets to obtain different tracking samples, and then the ridge regression classifier is used to determine the final position information of the targets. After that, the position information is further trained by the ridge regression classifier again. The process is performed repeatedly to complete the tracking of targets. The specific process is shown in Fig. 2.

Fig. 2.
figure 2

Flowchart of the KCF tracking algorithm

2.3 Target Position Prediction

Kalman filter is a recursive estimator that implements the estimation of motion states through the principle of feedback control. From the dynamic target tracking in the previous step, the motion vector of the targets can be obtained. According to the historical motion states of the targets, the current states of the targets can be predicted. The basic state model of the targets includes the observation equation and the state equation as follows:

$$ \left\{ {\begin{array}{*{20}l} {Z_{k} = H_{k} X_{k} + V_{k} } \hfill \\ {X_{k,k - 1} = A_{k,k - 1} X_{k - 1} + B_{k - 1} U_{k - 1} } \hfill \\ \end{array} } \right. $$
(5)

where \( Z_{k} \) represents the observed value of the target state, \( H_{k} \) represents the observation matrix, \( X_{k} \) represents the real state at time k, \( X_{k,k - 1} \) represents the target state estimated from the previous state, \( A_{k,k - 1} \) represents the state transition matrix from k − 1 to k, \( B_{k - 1} \) represents the system control matrix at time k − 1, \( U_{k - 1} \) represents the noise that influences the current motion law of the targets, such as acceleration and deceleration of the moving targets, \( Q \) is the self-covariance of \( U_{k - 1} \), and \( V_{k} \) represents the observation noise, which in this experiment represents the deviation during the tracking process. Therefore, the prediction equation of the next coordinate \( X_{k + 1,k} \) and its covariance matrix \( P_{k + 1,k} \) can be obtained as:

$$ \left\{ {\begin{array}{*{20}l} {X_{k + 1,k} = A_{k + 1,k} X_{k} + B_{k} U_{k} } \hfill \\ {P_{k + 1,k} = A_{k + 1,k} P_{k} A_{k + 1,k}^{T} + B_{k} Q_{k} B_{k}^{T} } \hfill \\ \end{array} } \right. $$
(6)

2.4 UAV Path Planning

This paper focuses on the optimization of ant colony algorithm which is slow in convergence and easy to fall into the local optimal solution. The probability of stagnation of the algorithm is reduced by limiting the increment of pheromone update and the dynamic change of volatile factors, also by using blending inheritance algorithm; thus, the UAV dynamic path planning can be realized. The specific steps are as follows:

Step 1: Information initialization:

$$ \tau_{ij} (0) = m/d_{\hbox{min} } $$
(7)

where \( \tau_{ij} (0) \) represents the pheromone from target \( i \) to target \( j \), \( m \) represents the number of ants, and \( d_{\hbox{min} } \) represents the distance between the closest two targets.

Step 2: Path construction by all ant state transition.

Calculate the probability of transition of each ant \( k \) from target \( i \) to target \( j \) by the following formula at time \( t \):

$$ p_{ij}^{k} (t) = \left\{ {\begin{array}{*{20}l} {\frac{{\tau_{ij}^{\alpha } (ij)\eta_{ij}^{\beta } }}{{\sum\nolimits_{{s \in {\text{allowed}}_{k} }} {\tau_{ij}^{\alpha } (ij)\eta_{ij}^{\beta } } }},} \hfill & {j \in {\text{allowed}}_{k} } \hfill \\ {0,} \hfill & {\text{other}} \hfill \\ \end{array} } \right. $$
(8)

where \( \eta_{ij} (t) = 1/d_{ij} \) represents the degree of expectation of ants from target \( i \) to target \( j \), \( \alpha \) represents the information heuristic factor, which indicates the influence of pheromone on the transition probability, \( \beta \) represents the expected heuristic factor, which indicates the influence of visibility on the transition probability of ants, \( {\text{allowed}} = \{ 1,2, \ldots ,n\} - {\text{tabu}}_{k} \) represents the targets which ant k has not visited, and \( {\text{tabu}}_{k} \) represents the targets that the ant k has passed.

Step 3: Pheromone update according to the steps which ants construct.

Ants will release pheromone on the path and update the pheromone locally according to the following formula. In order to increase the difference between the best and the worst paths, this paper adopts the maximum and minimum ant system to strengthen the optimal solution and weaken the worst solution:

$$ \tau_{ij} (t + 1) = \left\{ {\begin{array}{*{20}l} {(1 - \rho )\tau_{ij} (t) + \varepsilon (L_{\text{worst}} - L_{\text{best}} ),} \hfill & {{\text{if}}\;ij\;{\text{is the best path}} .} \hfill \\ {(1 - \rho )\tau_{ij} (t) - \varepsilon (L_{\text{worst}} - L_{\text{best}} ),} \hfill & {{\text{if}}\;ij\;{\text{is the worst path}} .} \hfill \\ {(1 - \rho )\tau_{ij} (t),} \hfill & {\text{other}} \hfill \\ \end{array} } \right. $$
(9)

where \( \rho \) represents the pheromone volatility coefficient, \( \varepsilon \) represents the pheromone enhancement coefficient, and \( L_{\text{best}} ,L_{\text{worst}} \) represent the length of the optimal path and the worst path, respectively, for all ants in this time.

Step 4: Update the number of iterations.

If the number of iterations is less than the set value \( N_{\hbox{max} } \), repeat step 2.

Finally, the ant colony will gradually converge on the best path through the constant updating of pheromone. The specific process is shown in Fig. 3.

Fig. 3.
figure 3

Flowchart of ant colony algorithm

3 Simulation Experiment

3.1 Single-Target Tracking Experiment

In order to demonstrate the effectiveness and feasibility of the algorithm, there are two simulation experiments for the single-target tracking and multi-target tracking of UAV.

The first experiment is the simulation of UAV’s approaching a single moving target. At first, a moving target is marked for tracking. Then, the marked target is tracked by the KCF tracking algorithm to obtain the target motion and position information, and the Kalman filter method is used to predict the moving target position. There are two UAVs for comparison in the experiment, one of which is an experimental UAV and the other is a comparison UAV. The experimental UAV is the UAV that tracks pre-targeted positions, and the comparison UAV is the UAV that tracks the current position of the target. In the experiment, the UAVs’ movement speed was set to 2 pixels per frame, and the target movement speed was about 1 pixel per frame. The experimental results are shown in Fig. 4.

Fig. 4.
figure 4

Experimental results of the simulation of a single moving target

The result shows that the flight path of the experimental UAV is shifted in advance to the moving direction, and the required path is relatively shorter. It means the algorithm can improve tracking efficiency and optimize the UAV path.

3.2 Multi-target Tracking Experiment

The second experiment is the simulation of the path planning of multiple moving targets for UAV. Based on the first experiment, this experiment expands the single target to multi-targets, then by using the improved ant colony algorithm to plan the UAV’s paths. The experimental results are as shown in Fig. 5.

Fig. 5.
figure 5

Experimental results of the simulation of the path planning of multiple targets

The experimental result shows that the algorithm can effectively adapt to track the targets’ movement and get the tracking sequence of the moving target to plan the UAV’s paths. It means that the UAV path planning algorithm is feasibility. And at the 50th frame, two UAVs have the same sequence of tracking the targets. But at 70 frames, the experimental UAV changed the tracking experimental, but the tracking sequence of the comparison UAV did not change. At 90 frames, the tracking sequence of the comparison UAV changes to the same as that of the experimental UAV. It means that the UAV path planning algorithm can effectively predict the moving target positions, and the algorithm can update the tracking sequence of the moving targets in advance to optimize the UAV tracking path.

4 Conclusions

In this paper, aiming at the problem of UAV path planning for multiple moving targets, firstly, the KCF algorithm is used to track the moving targets to obtain the positions of the targets. Then, Kalman filter is used to predict the positions of the moving targets, and finally, the improved ant colony algorithm is used to complete the dynamic path planning to achieve the UAV path planning for multiple moving targets. The experimental results show that the proposed scheme can effectively complete the dynamic optimization of the UAV path, thus improving the intelligence of the drone in the scene of multiple moving target tracking.