The Perturbed Variation

Maayan Harel, Shie Mannor

In the world of statistics and machine learning, we often ask: "Are these two datasets the same?" This is the classic Two-Sample Problem. But in the real world—especially in fields like Domain Adaptation—the answer is almost always "no." The more useful question is: "Are these two datasets similar enough for my purposes?"

A paper by Maayan Harel and Shie Mannor introduces a new tool to answer exactly that: The Perturbed Variation (PV). The PV is a novel discrepancy score that measures similarity between distributions by allowing for a user-defined "tolerance" for small differences. Unlike standard tests that check for exact equality, PV optimally "perturbs" distributions to see how well they can fit together, offering a computationally efficient and intuitive way to test for similarity in real-world data.

The Problem with Exact Equality

Most statistical tools are designed to detect any difference between two distributions. For example, the Total Variation (TV) distance is notoriously sensitive; even a tiny shift in a distribution can result in a maximum distance score, even if the two datasets are "perceptually" almost identical.

In practical applications like computer vision or gait analysis, we expect some noise or minor variations. We don't want a test that fails just because one person's walking pace is 1% faster than another's. The authors argue that similarity is domain-specific. We need a metric that "turns a blind eye" to variations below a certain threshold ($\epsilon$) while still penalizing larger discrepancies.

PV handles shifts based on the epsilon tolerance

How Perturbed Variation Works

The authors define the Perturbed Variation as the minimum probability that a pair of samples (coupled from two distributions) will be further apart than a distance $\epsilon$.

Mathematically, it’s a relaxation of the Total Variation distance. While TV counts any difference as a cost, PV allows mass to be moved within an $\epsilon$-neighborhood for free. Key technical highlights include:

  • Coupling Framework: It is formulated as an optimal mass transport problem (similar to the Earth Mover’s Distance or Wasserstein metric) but with a "step-function" cost: the cost is 0 if the distance is $\le \epsilon$, and 1 otherwise.
  • Algorithmic Efficiency: For discrete samples, computing the PV reduces to a Maximum Bipartite Matching problem. You build a graph where an edge exists between two points if they are within distance $\epsilon$, then find the largest possible matching. Unmatched points represent the discrepancy.
Conceptual diagram of matching points within an epsilon radius
  • Statistical Inference: The authors provide convergence bounds and use Bootstrap Bias-Corrected accelerated (BCa) intervals to create robust hypothesis tests for similarity.

Real-World Performance

The paper evaluates the PV score using three distinct setups, proving its robustness and flexibility:

  1. Synthetic Simulations: Using univariate uniform distributions with varying degrees of shift, the authors tested the statistical power of the PV test. Simulations showed that as sample sizes increase, the PV test's power to correctly reject dissimilarity grows rapidly.
  2. Video Clip Retrieval: On a dataset of 1,083 commercial videos, the task was to identify "similar" clips that had undergone transformations like brightness changes, logo insertion, or noise. PV proved invariant to most transformations, outperforming standard methods like Maximum Mean Discrepancy (MMD) because it ignored the "pixel noise" introduced by the transformations.
  3. Gait Recognition: Using accelerometer data from 20 individuals walking, the goal was to rank similarity based on physical characteristics. PV outperformed MMD and KNN-based scores in retrieving similar walking patterns.

Key Insights and Limitations

The Perturbed Variation sits comfortably between the Wasserstein distance (which cares about how far things move) and Total Variation (which only cares if they move). PV cares if they move more than $\epsilon$. Because the discrete version is a simple bipartite matching problem, it is significantly faster to compute than many other distribution-based distances that require complex optimization.

However, the metric does come with trade-offs:

  • Choosing $\epsilon$: The parameter $\epsilon$ is the "knob" that defines what counts as a "small change." While this makes the metric flexible, it also requires the user to have enough domain knowledge to choose an appropriate threshold.
  • The Curse of Dimensionality: The theoretical convergence bounds for PV depend heavily on the dimension of the data. While bootstrapping helps in practice, the theoretical guarantees weaken as you add more features.
  • Not a Strict Metric: PV does not satisfy the triangle inequality. While this isn't a dealbreaker for many applications, it means it cannot be used in certain geometric algorithms.

Ultimately, Perturbed Variation offers a highly practical, computationally efficient approach to the Two-Sample Problem, allowing researchers to finally test whether two datasets are, in fact, "close enough."

Summary updated

BibTeX
@inproceedings{harel2012perturbed,
  author = {Maayan Harel and Shie Mannor},
  title = {{The Perturbed Variation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2012},
  url = {https://openreview.net/forum?id=HkZFtdWdbH},
}
Figure