Diffusion-Based Hypothesis Testing and Change-Point Detection
Authors: Sean Moushegian, Taposh Banerjee, Vahid Tarokh
Organizations: Department of Electrical and Computer Engineering, Duke University, Durham, North Carolina 27708. · Department of Industrial Engineering, University of Pittsburgh, Pittsburgh, Pennsylvania 15213.
Score-based methods have recently seen increasing popularity in modeling and generation. Methods have been constructed to perform hypothesis testing and change-point detection with score functions, but these methods are in general not as powerful as their likelihood-based peers. Recent works consider generalizing the score-based Fisher divergence into a diffusion-divergence by transforming score functions via multiplication with a matrix-valued function or a weight matrix. In this paper, we extend the score-based hypothesis test and change-point detection stopping rule into their diffusion-based analogs. Additionally, we theoretically quantify the performance of these diffusion-based algorithms and study scenarios where optimal performance is achievable. We propose a method of numerically optimizing the weight matrix and present numerical simulations to illustrate the advantages of diffusion-based algorithms.
Figures & tables
Figure 1: Performance of LLR-based, Fisher-based, and diffusion-based Change-Point Detection Stopping Rules. In this simulation, P∞,P1 were chosen to be (a) Gaussian Distributions, (b) Gauss-Bernoulli Restricted Boltzmann Machine Distributions, and (c) Quartic Exponential Distributions. ARL and EDD are averaged over 10,000 sample paths.
Figure 2: ROC curves for diffusion-based, score-based, and LLR-based hypothesis tests, plotted for batch sizes n∈{1,10,100} . P∞,P1 are chosen to follow Gaussian Distributions (top), Gauss-Bernoulli Restricted Boltzmann Machine Distributions (middle), and Quartic Exponential Distributions (bottom). Each ROC curve uses 10,000 batches. Similar plots for n∈{5,25,50} are shown in Figure 3 in the Appendix.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 3: ROC curves for diffusion-based, score-based, and LLR-based hypothesis tests, plotted for batch sizes n∈{5,25,50} . P∞,P1 are chosen to follow Gaussian Distributions (top), Gauss-Bernoulli Restricted Boltzmann Machine Distributions (middle), and Quartic Exponential Distributions (bottom). Each ROC curve uses 10,000 batches. Note that similar plots for n∈{1,10,100} are provided in Figure 2 in the main text.
Classical CUSUM relies on the log-likelihood ratio of the underlying distributions, which cannot generally be computed from finite pre- and post-change samples alone. We propose diffusion-integrated score CUSUM (DI-SCUSUM), a training-free detector. We add Gaussian noise to the samples to form two smooth density estimates and calculate their Hyvärinen scores exactly, without training a score network. For each incoming observation, we sample a diffusion time, perturb the observation, and use the importance-weighted score difference as an increment in the DI-SCUSUM recursion. Under the assumption that observations follow the fixed empirical distributions, the post-change mean increment is proportional to the Kullback-Leibler (KL) divergence from the smoothed post-change to the smoothed pre-change empirical distribution. We establish exponential false-alarm scaling and a first-order delay bound that, for a fixed threshold and increment scaling, is inversely proportional to the KL divergence. In the calibrated anisotropic Gaussian simulation, DI-SCUSUM nearly matches likelihood-ratio CUSUM and reduces the measured detection delay by about 91% relative to score-based CUSUM. On MNIST and Oxford-IIIT Pet, DI-SCUSUM also has lower empirical conditional detection delay than SCUSUM at comparable false-alarm levels.
Score-based diffusion models are increasingly considered in settings where the underlying data distribution may differ from the training distribution, yet existing theoretical guarantees largely focus on the no-shift setting. In this work, we study robust score estimation under Wasserstein perturbations of a reference distribution. For the Ornstein--Uhlenbeck diffusion, we show that robust estimation decomposes into two fundamental components: the statistical cost of learning the reference distribution and the intrinsic cost of distribution shift. The latter scales quadratically with the Wasserstein radius, and this dependence is minimax optimal. We construct an explicit finite-sample estimator achieving the resulting robust minimax rate without knowing the shift radius. When the reference distribution lies on an unknown low-dimensional subspace, the statistical term adapts to the intrinsic dimension while the shift cost remains unchanged. Finally, we show that the same decomposition governs positive-time reverse sampling and obtain matching minimax guarantees in KL divergence. Together, these results characterize how finite data, intrinsic dimension, and distribution shift affect the robustness of score-based diffusion models.
Wei Luo, Neil K. Chada, Shijie Zhang +1
Department of Mathematical Sciences, Tsinghua University · Department of Mathematics, City University of Hong Kong, Hong Kong SAR · Artificial Intelligence Research Institute, Shenzhen MSU-BIT University +1
A rapidly growing range of sequential data tasks, such as identifying trend reversals in financial markets, auto-segmenting video and audio recordings, detecting changes in movement direction from motion sensors cannot be fully addressed without detection of distributional shifts in time-ordered data. We consider a sequential change-point detection problem where the conditional density switches at an unknown time, yet neither the pre- nor post-change distribution admits a closed-form. Classical likelihood-ratio statistics are inapplicable in this settings. A conditional diffusion model, trained on pre-change-point data with a frozen context encoder, defines a deterministic bijection via the probability flow ODE. Pre-change observations are mapped onto standard Gaussian latent variables. Post-change observations, processed through the same frozen map, deviate from this reference. We employ the Maximum Mean Discrepancy as the test statistic, derive closed-form expressions for its components under the Gaussian null, and establish its asymptotic distribution as a degenerate U-statistic. Afterwards we apply an online detection procedure of Shiryaev--Roberts to the resulting statistic with exact threshold calibration. The method detects arbitrary distributional shifts, including covariance rotations and higher-order structural breaks, without parametric assumptions on either regime.
Artem Kraevskiy, Artem Prokhorov
National Research University Higher School of Economics Moscow, Russia · The University of Sydney Business School & CIREQ & CEBDA Sydney, Australia