Maximum Mean Discrepancy on Exponential Windows for Online Change Detection

Florian Kalinke, Marco Heyden, Georg Gntuni, Edouard Fouché, Klemens Böhm

Abstract

Detecting concept drift in high-dimensional data streams is a critical challenge in modern data science. While the Maximum Mean Discrepancy (MMD) is a powerful non-parametric metric for identifying distributional shifts, its quadratic computational complexity has historically limited its application in real-time streaming environments. This paper introduces MMDEW (Maximum Mean Discrepancy on Exponential Windows), an algorithm that achieves polylogarithmic runtime and memory complexity. By integrating exponential windowing, kernel sum summaries, and logarithmic subsampling, MMDEW enables efficient, high-accuracy change detection on complex, high-dimensional data.

Introduction

In streaming applications such as sensor monitoring, financial fraud detection, and user behavior analysis, data distributions often shift over time—a phenomenon known as concept drift. Identifying these change points promptly is essential for maintaining the reliability of predictive models. The Maximum Mean Discrepancy (MMD) is a "gold-standard" approach because it can detect any disparity between distributions under mild conditions. However, classical MMD estimators scale quadratically ($O(n^2)$), making them computationally prohibitive for continuous monitoring where a naive implementation would reach $O(t^3)$ complexity over a stream of length $t$.

Methodology: The MMDEW Algorithm

MMDEW overcomes the MMD bottleneck through three primary innovations:

  1. Exponential Windows: Drawing inspiration from the ADWIN algorithm, MMDEW partitions the data stream into windows of exponentially increasing sizes ($2^0, 2^1, 2^2, \dots$). This structure allows for fine-grained sensitivity to recent changes while maintaining a coarse-grained historical baseline.
  2. Summary Statistics (Kernel Sums): Instead of raw data, windows store sums of kernel evaluations. These summaries are additive, allowing two windows of the same size to be merged efficiently.
  3. Logarithmic Subsampling: To bound memory, each window maintains a uniform sample of its observations, with the sample size scaling logarithmically with the window size.
The merging process of exponential windows $B_0$ and $B_0'$ into $B_1$, showing how kernel sums are updated to maintain summary statistics efficiently.

As shown in the figure above, the merging operation allows the algorithm to update its state in $O(\log t)$ time. Combined with the windowing strategy, MMDEW reduces the per-observation runtime complexity to $O(\log^2 t)$ and memory complexity to $O(\log t)$.

Comparative Analysis and Results

The authors compared MMDEW against several state-of-the-art change detection algorithms, including ADWINK, WATCH, and NEWMA.

Comparison of change detection algorithms. MMDEW is the only method achieving polylogarithmic complexity $O(\log^2 t)$ while supporting topological domains.

Experimental Performance

The algorithm was evaluated on synthetic multivariate distributions (up to 20 dimensions) and high-dimensional real-world benchmarks like CIFAR10, FashionMNIST, and Gas Sensor Arrays. Key findings include:

  • Accuracy: MMDEW achieved the highest F1-score on four out of five real-world datasets, outperforming competitors in detecting subtle shifts in high-dimensional spaces.
  • Detection Speed: MMDEW demonstrated superior performance in scenarios requiring rapid detection (short detection windows), catching changes faster than univariate-based methods.
  • Scalability: Empirical tests confirmed the theoretical $O(\log^2 t)$ complexity. While MMDEW has a higher initial fixed cost than simpler methods, its runtime remains nearly constant as the stream length increases, whereas naive MMD becomes unusable.

Conclusion

MMDEW represents a significant step forward in making kernel-based change detection practical for the streaming era. By leveraging exponential windows and efficient kernel sum updates, it provides a robust, non-parametric solution that scales to high-dimensional data without the prohibitive costs of traditional MMD. Future work includes automating kernel selection and exploring adaptive subsampling to further enhance sensitivity.

Summary updated

BibTeX
@article{kalinke2025maximum,
  author = {Florian Kalinke and Marco Heyden and Georg Gntuni and Edouard Fouché and Klemens Böhm},
  title = {{Maximum Mean Discrepancy on Exponential Windows for Online Change Detection}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
}
Figure