A Moving Target Tracking Method Based on Particle Filter and Mean-shift

Due to the limitation of using a single algorithm Mean-shift or particle filter, the deterministic tracker Mean-shift is introduced into the framework of particle filter, and a new hybrid tracking method based on particle filter and Mean-shift is proposed. The tracking method first uses Dynamic K-Means Soft Clustering algorithm to cluster multiple hypotheses, and then carries out Mean-shift deterministic search for the centers of clusters. The tracking experiments show that the proposed method can perform well when the target changes, rotates and scales, and achieves a satisfactory tracking speed.


Introduction
With the popularization of computer technology and the wide application of video surveillance, the technology of moving target tracking has been paid more and more attention. Current methods of moving target tracking can be divided into two kinds: hypothesis-based tracking and feature-based tracking.
Hypothesis-based tracking method is to find some conditions that can be used as hypothesis by analyzing the particularity of the target being tracked and the background environment, then to model the tracking problem, and to obtain the tracking of the target according to these hypothesis conditions. Kalman filter, optical flow and particle filter are the classical algorithms in this field. The basic idea of particle filter is to approximate the probability density function by looking for a group of random samples which propagate in the state space, and replace the integral operation with the sample mean, and to obtain the process of the minimum variance distribution of the state [2], which can approximate the state distribution of the system when the number of samples N → . The most important problem in the tracking process is that a large number of samples are needed to approximate the posterior probability density of the system. The more complex is the tracking environment, the more samples are needed to describe the posterior probability distribution, and the more complex is the algorithm. In addition, sample validity and diversity will be lost in the re-sampling stage, which will lead to sample degradation.
The feature-based tracking method track targets by detecting the specified features of the continuous frame image. The feature-based tracking method has less computation and higher real-time performance. Mean Shift algorithm is a typical representative in this field. Mean-shift target tracking algorithm uses histogram to model the target, and then achieves target matching and tracking by similarity measure. It has high real-time performance, but it can not guarantee the robustness of tracking in some occlusion cases because of the convergence to local extreme points. It combines particle filter with Mean-shift algorithm, and introduces Mean-shift into the framework of particle filter in this paper. On one hand, the tracking method of particle filter is used to obtain the initial position of the target, and then the Mean-shift tracking method is used to converge to the extreme value to achieve the accurate location of the tracking target. On the other hand, after resampling by particle filter, several cluster regions are obtained by clustering analysis for distribution of particles, and then Mean-shift analysis is performed on the points of the cluster centers. The experiment shows that it is very accurate for tracking targets by this method.

Particle Filter Algorithm
Particle filter algorithm is an approximate Bayesian filtering algorithm based on Monte Carlo simulation [3]. Sample the states of the targets tracked, calculate the weights of the samples, and finally uses the weights of the samples to represent the estimated value of the states of target tracked. In this algorithm, an approximate Bayesian solution can be obtained by updating an approximate solution of posterior probability density. When the number of particles tracked is large, the accuracy approaches the optimal estimate.

Mean-shift Algorithm
Mean-shift algorithm is a fast pattern matching algorithm without parameters based on kernel density estimation. For a finite data set A in N-dimension Euclidean space X, the sample mean near point x (x < X) can be defined as: Here, Mean-shift algorithm is to move data points to Mean-shift vector repeatedly and eventually converge. At this time, the position of the core corresponds to the extreme value of a probability density, i.e. the position of target mode. The algorithm can be described as: (1) Let y0 be the location of the target mode in the previous frame.
(2) Starting from the position y0 of the current frame image, the mean-shift algorithm is iterated to solve the optimal node y, so that the mode p(y) matches the q target mode best.
(3) Repeat steps (1) and (2) to get position of the final mode.

Establishment of Target Model
Because of the robustness of the color feature distribution, the color feature distribution is used to describe the moving target. Assuming that the color feature distribution function of the target template is MQ, then: In Formula(4), M is the quantization level of color histogram. In order to consider the real-time and accuracy requirements, the color space is generally quantized to 16×16×16, and u q is the distribution probability of the characteristic u.
Target model is established as followed: In Formula(5), 0 () x pn denotes the weight of the nth order histogram centered on 0 x , 0 x is the center of the target window, i x (i= 1,... n; n is the number of pixels) represents the pixel in the target window, K is a kernel function and h represents the bandwidth of the kernel function, The concept of "kernel function" in Mean-shift algorithm is used. Epanechnikov Kernel is selected as the kernel function, that is: As the weight of Epanechnikov Kernel decrease slowly, that helps to improve the stability of tracking targets.
The Bhattacharyya coefficient is used as the evaluation function to evaluate the similarity between candidate region and target region: Here,

[ , ]
x pq  represents the similarity between the target model 0 () x pn and the pre-building template () qn at 0 x . The greater is the degree of similarity, the higher the similarity is; m indicates the order of color quantization.

State Model
Using a rectangular box to represent the particle size and its size is fixed, then the target state can be described as: xy represents the center of the rectangular box, A simple auto regressive method is used to deal with it: 1 k v − is the noise of a normalized system, its range is {} nN tn s −= by using Dynamic K-Means Soft Clustering algorithm(DKMSC). The number of initial clustering points selected according to the principle of Minimum-Maximum is the integral part of the square root of the number of sample points to be clustered; because k-means algorithm is sensitive to outliers, the sample points with low similarity to each cluster are not added to any cluster in the iteration of the algorithm; the number of final clusters is determined dynamically according to similarity. The algorithm is described as follows:

Description of Tracking Algorithm (1) Initialization and Computing the Weights of the Particles
Step1: Define minimum similarity threshold as  , soft category similarity threshold as  , merging cluster threshold as  .
Step2 (4) Particles Re-sampling Because of the existence of particle degradation, the weights of most particles are smaller and smaller weights in the process of propagation. Only a few of them have larger weights . If continue to use them for tracking, the targets tracked are easily lost. Therefore, when the number of particles is less than the threshold th N , the particles with smaller weights will be eliminated and resample around the particles with larger weights, and to keep the total number of particles unchanged. (

5)Target State Estimation
The state estimation of the target tracked is computed by the global weighting method. The proportion of particles in a posterior estimate is determined by the weight of the particle itself, the sum of the weights of particles are used to estimate the state of the target. The formula is as follows:

) Experimental Results and Analysis
In the experiment, pedestrians and cars moving on the road are selected as tracking targets, and RGB is used in color space. Before tracking, the target region is selected manually to learn the probability distribution model of target color. In the following tracking process, this color probability distribution model is used as the color feature reference model of candidate targets. Select one of the videos as an example to illustrate.
According to the experimental experience, when the value of parameter  ,  , in Dynamic K-Means Soft Clustering is 0.2, 0.5, 0.7 Respectively, the algorithm can get a better result. Results As shown in Figure-1 below, the combined tracker based on particle filter and Mean-Shift has better tracking effect for normal target tracking.
As shown in the figure-1, the tracking vehicle in the video rotates, and the size of the vehicle changes, the pedestrian clothes is close to the road color. The experimental results show that the tracking method proposed in this paper has higher accuracy and stronger robustness.