Skip to main content
QUICK REVIEW

[Paper Review] Feature Shift Detection: Localizing Which Features Have Shifted via Conditional Distribution Tests

Sean Kulinski, Saurabh Bagchi|arXiv (Cornell University)|Jul 14, 2021
Time Series Analysis and ForecastingComputer Science9 citations
TL;DR

This paper proposes a novel method for detecting and localizing distribution shifts in multivariate sensor data by performing conditional distribution hypothesis tests using a score-based test statistic derived from density model gradients. The approach enables efficient, simultaneous testing across all features in a single forward and backward pass, achieving state-of-the-art performance in both shift detection and feature-level localization, even under low mutual information and natural data shifts.

ABSTRACT

While previous distribution shift detection approaches can identify if a shift has occurred, these approaches cannot localize which specific features have caused a distribution shift -- a critical step in diagnosing or fixing any underlying issue. For example, in military sensor networks, users will want to detect when one or more of the sensors has been compromised, and critically, they will want to know which specific sensors might be compromised. Thus, we first define a formalization of this problem as multiple conditional distribution hypothesis tests and propose both non-parametric and parametric statistical tests. For both efficiency and flexibility, we then propose to use a test statistic based on the density model score function (i.e. gradient with respect to the input) -- which can easily compute test statistics for all dimensions in a single forward and backward pass. Any density model could be used for computing the necessary statistics including deep density models such as normalizing flows or autoregressive models. We additionally develop methods for identifying when and where a shift occurs in multivariate time-series data and show results for multiple scenarios using realistic attack models on both simulated and real world data.

Motivation & Objective

  • To address the critical gap in existing distribution shift detection methods that cannot localize which specific features (e.g., sensors) have shifted.
  • To formalize the problem of feature shift detection as multiple conditional distribution hypothesis tests to improve detection of correlated adversarial attacks.
  • To develop an efficient, scalable test statistic that enables simultaneous testing across all features using only one forward and backward pass through a density model.
  • To extend the method to time-series data for identifying both when and where attacks occur in dynamic sensor networks.
  • To demonstrate robust performance on real-world and simulated datasets under realistic adversarial models, including natural data shifts.

Proposed method

  • The method uses a score-based test statistic derived from the Fisher divergence, computed as the gradient of the log-density with respect to the input, enabling efficient computation across all features simultaneously.
  • The test statistic is computed using any differentiable density model, including normalizing flows and autoregressive models, leveraging existing model gradients for low computational overhead.
  • Conditional distribution hypothesis tests are formulated to detect shifts in the distribution of a feature given the values of other features, increasing sensitivity to correlated attacks.
  • For time-series data, the method employs time-aware bootstrapping to model temporal dependencies and distinguish adversarial shifts from natural data drift.
  • The approach supports both non-parametric and parametric statistical testing frameworks, allowing flexibility in model assumptions.
  • The method is designed for online deployment, enabling real-time detection at every time step with minimal computational cost.

Experimental results

Research questions

  • RQ1Can we detect distribution shifts in multivariate sensor data and localize which specific features have been manipulated by an adversary?
  • RQ2Can conditional distribution testing improve detection of adversarial attacks that match marginal distributions but not joint dependencies?
  • RQ3How efficiently can we compute shift detection statistics across all features simultaneously without sacrificing accuracy?
  • RQ4Can the proposed score-based test statistic maintain high performance under low mutual information between features?
  • RQ5How does the method perform in the presence of natural data shifts common in real-world time-series sensor data?

Key findings

  • The score-based test statistic achieved state-of-the-art performance in both shift detection and localization across all evaluated datasets, outperforming Gaussian-based baselines.
  • The method successfully detected adversarial attacks in simulated sensor networks even when individual sensor readings appeared inlier-like, due to its sensitivity to joint distribution shifts.
  • On the Energy and Gas datasets, the method maintained high detection and localization precision even when the time axis was unshuffled, indicating robustness to temporal reordering.
  • For the COVID-19 dataset, the time-aware bootstrapping method set the detection threshold too high due to strong benign shifts, resulting in 0% detection and localization in the unshuffled case.
  • The approach scales efficiently with the number of sensors, reducing computation by approximately O(d) compared to per-feature testing, due to single-pass gradient computation.
  • The method demonstrated effectiveness with deep density models such as normalizing flows and autoregressive models, suggesting broad applicability to modern generative models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.