NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Uncertainty-aware Evaluation of Auxiliary Anomalies with the Expected Anomaly Posterior

Lorenzo Perini, Maja Rudolph, Sabrina Schmedding, Chen Qiu

Abstract

Training effective anomaly detectors is notoriously difficult due to the inherent scarcity of real-world anomalies. While researchers frequently employ synthetic "auxiliary" anomalies to bridge this gap, poor-quality synthetic data can inadvertently degrade model performance. This paper introduces the Expected Anomaly Posterior (EAP), a novel example-wise score function that quantifies the quality of auxiliary anomalies. By balancing how "anomalous" a sample appears against how "realistic" it remains relative to the target distribution, EAP provides a principled, Bayesian framework for data valuation in anomaly detection.

Introduction

In critical domains such as autonomous driving, medical imaging, and industrial inspection, anomalies—such as a pedestrian in a roadway or a hairline fracture on a turbine blade—are rare but catastrophic if missed. To train robust detectors, practitioners often augment datasets with synthetic anomalies. However, the utility of these synthetic examples is often inconsistent.

Synthetic anomalies typically fail in two distinct ways:

  1. Indistinguishability: The samples are too similar to normal data, which confuses the model’s decision boundary.
  2. Unrealism: The samples are so "alien" to the original data distribution that the model learns features irrelevant to real-world applications.

Historically, measuring the quality of individual synthetic samples has required computationally expensive methods like Shapley values or Influence Functions, which often require retraining models hundreds of times. EAP addresses these challenges by providing a fast, uncertainty-aware metric that requires only a single training pass.

The Expected Anomaly Posterior (EAP) Framework

The authors propose treating anomaly quality as an uncertainty quantification problem. The EAP framework models the probability of an example being a true anomaly (denoted as $\pi_x$) using a Beta distribution. The resulting EAP score is the expectation of this posterior, which mathematically synthesizes two critical dimensions of uncertainty:

  • Aleatoric Uncertainty (Class-conditional probability): This measures the extent to which the detector perceives a sample as an anomaly versus a normal observation.
  • Epistemic Uncertainty (Data density): This measures how well a sample fits within the overall data distribution.

Practical Implementation

To make EAP computationally viable for high-dimensional data, the framework utilizes a Rarity Score to estimate density efficiently. A Squashing Scaler is then applied to map raw anomaly scores into well-behaved probabilities. Unlike traditional data valuation methods that rely on leave-one-out retraining, EAP evaluates the utility of an auxiliary sample based on the detector's state after a single training session, making it orders of magnitude faster than existing baselines.

Experimental Design

The researchers conducted an extensive evaluation across 40 benchmark datasets, categorized into:

  • 18 Image Datasets: Including the MvTec AD industrial suite and three Surface Defect Inspection (SDI) datasets.
  • 22 Tabular Datasets: Sourced from the Adbench benchmark, covering diverse real-world scenarios.

For each dataset, the authors constructed auxiliary sets containing a mix of "realistic" (actual anomalies), "indistinguishable" (mislabeled normal samples), and "unrealistic" (out-of-distribution samples from unrelated datasets) to test EAP’s ability to rank data quality correctly.

Key Insights and Results

The "Sweet Spot" of Anomaly Quality

EAP is designed to peak when an anomaly exists in a specific "sweet spot": it must be different enough from normal data to be distinguishable, yet similar enough to the training distribution to be realistic. The authors provide theoretical guarantees that EAP will consistently rank realistic anomalies higher than those that are either too similar to the norm or too alien to the distribution.

Performance Benchmarks

  • Superior Ranking: EAP outperformed 12 adapted baselines, including DataShap and Influence Functions, achieving the best average rank (3.18 for images and 3.14 for tabular data) across all metrics.
  • Downstream Accuracy: When the top-ranked 33% of anomalies (as identified by EAP) were used for training, models saw a 4 to 10 point improvement in test accuracy compared to models trained on anomalies selected by other methods.
  • Zero-Shot Application: The framework was successfully applied to prompt tuning for CLIP. By using EAP to select the most effective synthetic anomalies for tuning, the authors achieved a state-of-the-art average AUC of 82.4% on the MvTec dataset.

Limitations and Future Directions

While EAP represents a significant step forward, the authors identified specific edge cases. In the "Tile" dataset, where real anomalies are visually extreme and look nothing like the normal tiles, EAP undervalued the real anomalies because they fell into zero-density regions. This suggests that if the target anomalies are truly "alien," EAP’s emphasis on realism may require adjustment. Additionally, the method's reliance on a Beta prior suggests that performance in purely unsupervised settings may benefit from further refinement of density estimation techniques.

Conclusion

The Expected Anomaly Posterior offers a principled, efficient, and theoretically grounded approach to evaluating auxiliary data. By framing data quality through the lens of uncertainty, EAP allows researchers to filter out low-quality synthetic samples, significantly boosting the performance of anomaly detection systems in data-scarce environments.

Summary updated

BibTeX
@article{perini2025uncertainty,
  author = {Lorenzo Perini and Maja Rudolph and Sabrina Schmedding and Chen Qiu},
  title = {{Uncertainty-aware Evaluation of Auxiliary Anomalies with the Expected Anomaly Posterior}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
  url = {https://openreview.net/forum?id=Jhbe0moch8},
}
Figure