Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Machine learning›Mean Shift
Machine learning

Mean Shift

Mean Shift Clustering and Mode-Seeking Algorithm · Also known as: mean-shift clustering, mean shift mode seeking, kernel mean shift, nonparametric mode detection

Mean Shift is a non-parametric, iterative mode-seeking algorithm that identifies clusters as the peaks of an underlying probability density function. Originally introduced by Fukunaga and Hostetler (1975) for gradient estimation in pattern recognition, it was substantially extended and popularized by Comaniciu and Meer (2002) for robust feature-space analysis and image segmentation. Unlike k-means, Mean Shift requires no prior specification of the number of clusters, deriving cluster structure entirely from the data density.

ScholarGate
  1. Machine learning
  2. v1
  3. 3 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Mean Shift
DBSCANHierarchical ClusteringK-meansSpectral Clustering

When to use it

Mean Shift is appropriate when the true number of clusters is unknown or unnatural to specify in advance, when cluster shapes are expected to be irregular or non-convex, and when the density of the data is the natural concept of structure. It is well suited to image segmentation, object tracking in computer vision, and exploratory clustering of spatial or feature data. The main assumption is that clusters correspond to modes of the underlying density, which holds when data are generated by a mixture of unimodal components without requiring a parametric form. Meaningful results require a reasonably sized dataset (at least several dozen points per expected cluster) and a thoughtfully chosen bandwidth; automatic bandwidth selection methods such as Silverman's rule or cross-validation are recommended.

Strengths & limitations

Strengths
  • No need to specify the number of clusters k in advance; it emerges from the data density.
  • Finds arbitrarily shaped clusters, unlike k-means which assumes spherical structure.
  • Robust to outliers because the mode is a density peak and isolated points rarely form modes.
  • Convergence to a local mode is guaranteed for Epanechnikov and Gaussian kernels (Comaniciu & Meer, 2002).
  • Directly interpretable as gradient ascent on a density estimate, with a clear probabilistic motivation.
Limitations
  • Computational cost is O(n²) per iteration naively, making it slow on large datasets without acceleration structures such as ball trees or approximate nearest-neighbor search.
  • Results are sensitive to the choice of bandwidth h; a poor bandwidth can merge distinct clusters or fragment single clusters.
  • No closed-form automatic bandwidth selection is universally applicable; cross-validation or domain knowledge is needed.
  • Does not scale well to very high-dimensional spaces due to the curse of dimensionality affecting the density estimate.
  • Produces no explicit generative model, so predicting cluster membership for new points requires re-running the algorithm or using a proximity heuristic.

Frequently asked

How do I choose the bandwidth?

Bandwidth selection is the central practical challenge. Common strategies include Silverman's rule of thumb (h proportional to n^{-1/(d+4)}), least-squares cross-validation on the kernel density estimate, or a grid search guided by a cluster validity index such as the silhouette score. It is good practice to run Mean Shift over a range of bandwidths and inspect how the number of modes and their positions change.

Does Mean Shift always converge?

Yes, for the Epanechnikov and Gaussian kernels — the two most commonly used profiles — Comaniciu and Meer (2002) proved that the iterative update sequence is monotonically increasing in density and therefore guaranteed to converge to a local mode. Convergence speed depends on the bandwidth and data geometry.

How does Mean Shift compare to DBSCAN?

Both are density-based and require no pre-specified number of clusters. DBSCAN defines clusters via reachability from core points and naturally labels noise as outliers, making it more explicit about what constitutes noise. Mean Shift, by contrast, defines clusters as basins of attraction of density modes; every point is assigned to some mode, with isolated points forming their own single-point modes. Mean Shift tends to be smoother but computationally heavier for large n.

Is Mean Shift suitable for very large datasets?

In its naive form, Mean Shift is O(n²) per iteration and can be prohibitive for tens of thousands of points. Practical remedies include using only a subset of points as seeds, employing ball-tree or k-d tree structures to limit the neighborhood search, or using the Blurring Mean Shift variant. For very large datasets, approximate methods or sub-sampling with subsequent assignment are standard practice.

Sources

  1. Fukunaga, K. & Hostetler, L. D. (1975). The estimation of the gradient of a density function, with applications in pattern recognition. IEEE Transactions on Information Theory, 21(1), 32–40. DOI: 10.1109/TIT.1975.1055330 ↗
  2. Comaniciu, D. & Meer, P. (2002). Mean shift: A robust approach toward feature space analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5), 603–619. DOI: 10.1109/34.1000236 ↗
  3. Hastie, T., Tibshirani, R. & Friedman, J. (2009). The Elements of Statistical Learning (2nd ed., Ch. 14). Springer. ISBN: 978-0-387-84858-7

How to cite this page

ScholarGate. (2026, June 3). Mean Shift Clustering and Mode-Seeking Algorithm. ScholarGate. https://scholargate.app/en/machine-learning/mean-shift

Related methods

DBSCANHierarchical ClusteringK-meansSpectral Clustering

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • DBSCANMachine learning↔ compare
  • Hierarchical ClusteringMachine learning↔ compare
  • K-meansMachine learning↔ compare
  • Spectral ClusteringMachine learning↔ compare
Compare side by side →

Similar methods

K-meansSpectral ClusteringOnline K-meansK-Means ClusteringFuzzy C-MeansKernel Density EstimationDBSCANRobust k-means

Related reference concepts

K-Means ClusteringClustering AlgorithmsCluster AnalysisModel-Based ClusteringImage SegmentationDensity Estimation

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Mean Shift (Mean Shift Clustering and Mode-Seeking Algorithm). Retrieved 2026-07-21 from https://scholargate.app/en/machine-learning/mean-shift · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Fukunaga, K. & Hostetler, L. D.; extended by Comaniciu, D. & Meer, P.
Year
1975
Type
Non-parametric mode-seeking / density-based clustering
Task
Clustering, image segmentation, feature-space analysis
NumClustersRequired
No
KernelDefault
Epanechnikov or Gaussian
ConvergenceGuaranteed
Yes
Related methods
DBSCANHierarchical ClusteringK-meansSpectral Clustering
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account