Mean shift

Mean shift is a non-parametric feature-space mathematical analysis technique for locating the maxima of a density function, a so-called mode-seeking algorithm.

[1] Application domains include cluster analysis in computer vision and image processing.

[2] The mean shift procedure is usually credited to work by Fukunaga and Hostetler in 1975.

[1] This is an iterative method, and we start with an initial estimate

This function determines the weight of nearby points for re-estimation of the mean.

Typically a Gaussian kernel on the distance to the current estimate is used,

is called mean shift in Fukunaga and Hostetler.

Although the mean shift algorithm has been widely used in many applications, a rigid proof for the convergence of the algorithm using a general kernel in a high dimensional space is still not known.

[5] Aliyari Ghassabeh showed the convergence of the mean shift algorithm in one dimension with a differentiable, convex, and strictly decreasing profile function.

[6] However, the one-dimensional case has limited real world applications.

Also, the convergence of the algorithm in higher dimensions with a finite number of the stationary (or isolated) points has been proved.

[5][7] However, sufficient conditions for a general kernel function to have finite stationary (or isolated) points have not been provided.

The first question, then, is how to estimate the density function given a sparse set of samples.

One of the simplest approaches is to just smooth the data, e.g., by convolving it with a fixed kernel of width

This approach is known as kernel density estimation or the Parzen window technique.

from the equation above, we can find its local maxima using gradient ascent or some other optimization technique.

The problem with this "brute force" approach is that, for higher dimensions, it becomes computationally prohibitive to evaluate

Instead, mean shift uses a variant of what is known in the optimization literature as multiple restart gradient descent.

, mean shift computes the gradient of the density estimate

and The two most frequently used kernel profiles for mean shift are:

Mean-shift is a hill climbing algorithm which involves shifting this kernel iteratively to a higher density region until convergence.

The mean shift vector always points toward the direction of the maximum increase in the density.

At every iteration the kernel is shifted to the centroid or the mean of the points within it.

The method of calculating this mean depends on the choice of the kernel.

At convergence, there will be no direction at which a shift can accommodate more points inside the kernel.

The mean shift algorithm can be used for visual tracking.

The simplest such algorithm would create a confidence map in the new image based on the color histogram of the object in the previous image, and use mean shift to find the peak of a confidence map near the object's old position.

The confidence map is a probability density function on the new image, assigning each pixel of the new image a probability, which is the probability of the pixel color occurring in the object in the previous image.

-dimensional input and filtered image pixels in the joint spatial-range domain.

For each pixel, Variants of the algorithm can be found in machine learning and image processing packages: