- Introduced by
- Ester, M., Kriegel, H.-P., Sander, J., Wimmer, M., & Xu, X.
- Year
- 1998
- Type
- Incremental density-based clustering
- Family
- Machine learning
What does it do?
Online DBSCAN extends the density-based clustering algorithm DBSCAN to data that arrives continuously, so the clustering does not have to be recomputed over the whole dataset.
Each new observation is added to the existing cluster structure through local epsilon-neighborhood queries. It is intended for streaming and data-warehousing settings where the data set grows incrementally.
The intuition behind the method
Batch DBSCAN groups data in one pass: dense neighborhoods become clusters, and sparse points are labeled as noise. When new data arrives, re-running the full algorithm repeats work that has already been done. Online DBSCAN instead treats the existing cluster assignment as the starting state. Each incoming point is checked against its epsilon-neighborhood. If it falls in a dense region, it joins or expands a nearby cluster, may merge clusters that were previously separate, and may turn earlier noise points into cluster members. Updates are normally confined to the neighborhood of the new point, although a merge can propagate relabeling further through the affected clusters.
History
The incremental variant was presented by Ester, Kriegel, Sander, Wimmer, and Xu at VLDB in 1998, for mining in data-warehousing environments, where the stored data grows over time. It extends batch DBSCAN, whose core, border, and noise concepts it keeps. Cao et al. (SDM 2006) developed DenStream, a related density-based stream clustering method that summarizes clusters of arbitrary shape and outliers in an evolving stream using weighted micro-clusters. Work on incremental density-based clustering continues, particularly for streaming settings.
When to use it
Use Online DBSCAN when data arrives continuously or in batches and full re-clustering would be too expensive, for example with sensor streams, network logs, real-time transaction monitoring, or data warehouses that grow over time. It fits low- to medium-dimensional continuous data with irregularly shaped clusters, where the number of clusters is not known in advance. Do not use it when the data is high-dimensional, because the epsilon-neighborhood loses meaning there. It is also a poor choice when the density structure changes substantially over time, since concept drift calls for windowed or adaptive variants, and when every point must be labeled immediately under strict latency limits.
Limitations and considerations
- Sensitive to the epsilon and MinPts hyperparameters, which must be chosen before streaming begins and may be hard to tune without a representative seed dataset.
- Performance degrades in high-dimensional spaces because the epsilon-neighborhood concept loses discriminative power.
- Cluster merging triggered by a new bridge point can cause cascading updates that are costly when many clusters become connected.
- Standard online DBSCAN does not handle concept drift or data deletion; windowed or decay-weighted variants are needed for evolving distributions.
- The cost of each insertion depends on the spatial index and the dimensionality. Tree-based indexes such as R-trees, k-d trees and ball trees keep neighborhood queries efficient in low dimensions, but their advantage diminishes as dimensionality grows. No general throughput figure applies across datasets.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- A new point normally updates only the cluster structure in its own neighborhood, so full re-clustering is avoided. Cluster merges are the main exception.
- Inherits DBSCAN's ability to find arbitrarily shaped clusters and to label outliers as noise.
- The number of clusters does not have to be specified in advance.
- Suits streaming and data-warehousing pipelines where data grows incrementally.
- Earlier noise points can be attached to a cluster when later points make them density-reachable, so the noise set can shrink without a global rescan.
Applications
- Real-time anomaly detection in sensor and IoT data streams.
- Incremental geospatial clustering of location traces as new GPS records arrive.
- Network intrusion detection where traffic logs grow continuously.
- Online customer segmentation in e-commerce platforms with live transaction data.
How it works
How it works
An initial cluster structure is set up, either by running batch DBSCAN on a seed dataset or by starting from an empty state. A spatial index, such as an R-tree or k-d tree, is built so that epsilon-neighborhood queries stay fast as points arrive.
Each new point p is inserted into the spatial index. This makes p available to later neighborhood queries and lets p query the index for its own neighbors among the points already indexed.
The epsilon-neighborhood of p is retrieved from the index. The count includes p itself, as in the definition of N_epsilon(p) above. If the number of neighbors meets the MinPts threshold, p is a core point. Otherwise p may be a border point of a nearby cluster, or it may remain noise.
Formula
N_{\varepsilon}(p) = \{q \in D \mid \text{dist}(p,q) \leq \varepsilon\}If p is a core point, the points density-reachable from it are explored. Earlier noise points that now fall within reach of p are reclassified as cluster members. If p connects two existing clusters, their labels are merged, and the change is propagated through the border points of the merged clusters. This propagation is the main source of non-local updates.
Non-core points near p that had no cluster assignment are assigned as border points of the cluster containing p. A border point that is density-reachable from more than one cluster is assigned to only one of them, and which one can depend on the order in which points arrived, as in batch DBSCAN. The noise set shrinks as the data becomes denser, and no global rescan is needed.
Common pitfalls
- Setting epsilon and MinPts on a small seed sample that is not representative of the full stream, which leads to poor cluster quality as more data arrives.
- Ignoring cluster merges. When two clusters merge because of a new bridge point, downstream consumers that keep old cluster IDs may receive inconsistent labels.
- Applying Online DBSCAN to high-dimensional data without first reducing its dimension, where epsilon-neighborhoods become nearly uniform.
- Treating all noise points as true outliers rather than as points that may become density-reachable as more data arrives.
Frequently asked questions
How do I choose epsilon and MinPts for a stream?
Run batch DBSCAN on a representative seed sample to find reasonable parameters, then fix them for the stream. Alternatively, use a k-distance plot on the seed data to identify the elbow point for epsilon. Be prepared to re-tune if the stream distribution drifts significantly.
What happens when a new point merges two previously separate clusters?
Border points of both clusters may need to be re-examined and relabeled under the merged cluster ID. In large datasets this relabeling can be expensive, especially when many clusters are connected.
Is Online DBSCAN the same as DenStream?
No. DenStream (Cao et al., 2006) is a related but distinct algorithm. It summarizes an evolving stream with weighted micro-clusters and distinguishes potential core and outlier micro-clusters. Online DBSCAN, as described here, does not use micro-clusters, and each new point updates the regions of the cluster structure near it.
Can I delete points from an Online DBSCAN model?
Standard Online DBSCAN supports only insertions. Supporting deletions requires tracking which cluster memberships depend on each point and reversing those assignments when the point is removed, which is significantly more complex and is an active research problem.
Does Online DBSCAN scale to very large streams?
It scales reasonably in low dimensions with a good spatial index (R-tree, ball tree). In high dimensions or very high-throughput streams, micro-cluster-based methods such as DenStream, which summarize the stream, are an alternative to evaluate. The trade-offs depend on the data and are not quantified here.
Related methods
Sources
Ester, M., Kriegel, H.-P., Sander, J., Wimmer, M., & Xu, X. (1998). Incremental Clustering for Mining in a Data Warehousing Environment. In Proceedings of the 24th International Conference on Very Large Data Bases (VLDB), pp. 323–333.
Open publication referenceCao, F., Ester, M., Qian, W., & Zhou, A. (2006). Density-Based Clustering over an Evolving Data Stream with Noise. In Proceedings of the 2006 SIAM International Conference on Data Mining (SDM), pp. 328–339.
Open DOI reference