Sampling in Dirichlet Process Mixture Models for Clustering Streaming Data

Or Dinari, Oren Freifeld

Abstract

Practical tools for clustering streaming data must be fast enough to handle the arrival rate of the observations. Typically, they also must adapt on the fly to possible lack of stationarity; i.e., the data statistics may be time-dependent due to various forms of drifts, changes in the number of clusters, etc. The Dirichlet Process Mixture Model (DPMM), whose Bayesian nonparametric nature allows it to adapt its complexity to the data, seems a natural choice for the streaming-data case. In its classical formulation, however, the DPMM cannot capture common types of drifts in the data statistics. Moreover, and regardless of that limitation, existing methods for online DPMM inference are too slow to handle rapid data streams. In this work we propose adapting both the DPMM and a known DPMM sampling-based non-streaming inference method for streaming-data clustering. We demonstrate the utility of the proposed method on several challenging settings, where it obtains state-of-the-art results while being on par with other methods in terms of speed.

Introduction

Clustering data in real-time presents a significant challenge for modern machine learning. In a streaming environment, data arrives continuously and often at high velocities, precluding the possibility of storing the entire dataset for traditional batch processing. Furthermore, real-world data streams are frequently non-stationary; clusters may emerge, vanish, or drift over time—a phenomenon known as "concept drift."

The Dirichlet Process Mixture Model (DPMM) is a Bayesian nonparametric tool ideally suited for this task because it automatically learns the number of clusters ($K$) from the data. However, standard DPMMs face three critical hurdles in streaming contexts: high memory requirements for multiple passes, slow inference speeds, and a "forgetting problem" where the influence of new data diminishes over time, making the model too rigid to adapt to drift.

Methodology: The ScStream Approach

The researchers developed ScStream, a streaming-data clustering method that adapts a parallel DPMM sampler for single-pass, high-speed environments. ScStream introduces several key innovations:

  • Damped Windowing: To address non-stationarity, ScStream maintains "weighted sufficient statistics" using a time-decaying kernel ($2^{-\lambda(B-b)}$). This mechanism allows the model to prioritize recent data and "forget" the distant past, enabling agility in the face of concept drift.
  • Deterministic Subroutine for Stability: To prevent "label switching"—where cluster IDs fluctuate randomly between batches—ScStream employs a deterministic step based on predictive posterior distributions. By using an argmax approach to assign points to the most likely cluster, the algorithm achieves significantly higher stability.
  • Dynamic Cluster Management: The model retains split and merge moves, allowing the number of clusters to fluctuate naturally as the stream evolves.
  • Efficiency via Sufficiency: By relying on sufficient statistics (e.g., sums and squared sums) rather than raw data, ScStream maintains a constant memory footprint regardless of stream duration.

Experimental Evaluation

ScStream was evaluated against a suite of competitors, including BIRCH, CluStream, and DBSTREAM, across diverse datasets:

  • Synthetic: 2D Gaussians and 100D Multinomials with artificial concept drift.
  • Real-world Tabular: CoverType (forest vegetation) and 20NewsGroup (text).
  • Computer Vision: Features from ImageNet100 and ImageNet1K extracted via self-supervised learning (SwAV) and PCA.
  • Video: Temporal segmentation of the 'kite-surf' sequence from the DAVIS dataset.

Results and Discussion

ScStream consistently outperformed established streaming algorithms across various metrics, including Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and Purity.

Performance comparison of ScStream against baseline methods across multiple datasets and metrics.

As shown in the performance table, ScStream achieved state-of-the-art results on challenging datasets like ImageNet100, where it reached an ARI of 0.63, compared to 0.49 for the next best streaming competitor. In video segmentation tasks, the method successfully tracked objects against complex backgrounds, maintaining consistent cluster labels even as lighting and positions shifted.

In terms of computational efficiency, ScStream is competitive with other sophisticated streaming methods. While simpler algorithms like Mini-Batch K-Means are faster, they often lack the adaptive capabilities of ScStream.

Execution time comparison (in seconds) for ScStream and competing algorithms.

Conclusion and Future Work

ScStream demonstrates that Bayesian Nonparametrics can be effectively scaled for high-speed data streams by incorporating forgetting mechanisms and stabilizing inference. Currently, the framework is limited to exponential family components (e.g., Gaussians), which assumes specific cluster shapes. Future research may extend ScStream to handle arbitrarily shaped clusters or further optimize parallel implementations for even higher-velocity data sources, such as network backbones or high-resolution sensor arrays.

Summary updated

BibTeX
@inproceedings{dinari2022sampling,
  author = {Or Dinari and Oren Freifeld},
  title = {{Sampling in Dirichlet Process Mixture Models for Clustering Streaming Data}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=z9Kv64Ft3Zl},
}
Figure