Table of Contents
Fetching ...

Calibrating Tabular Anomaly Detection via Optimal Transport

Hangting Ye, He Zhao. Wei Fan, Xiaozhuang Song, Dandan Guo, Yi Chang, Hongyuan Zha

TL;DR

CTAD tackles the heterogeneity of tabular anomaly detection by proposing a model-agnostic, OT-based calibration framework. It treats normality through two complementary representations—a random empirical snapshot and a K-means structural view—and measures test-sample disruption via OT between these views. The approach comes with theoretical guarantees of a positive OT gap between anomalies and normals and shows consistent, statistically significant improvements across 34 datasets and 7 detectors, including state-of-the-art deep models, with negligible online overhead. As a drop-in post-processing step, CTAD offers robust, hyperparameter-insensitive gains without retraining, making it practical for real-world deployment.

Abstract

Tabular anomaly detection (TAD) remains challenging due to the heterogeneity of tabular data: features lack natural relationships, vary widely in distribution and scale, and exhibit diverse types. Consequently, each TAD method makes implicit assumptions about anomaly patterns that work well on some datasets but fail on others, and no method consistently outperforms across diverse scenarios. We present CTAD (Calibrating Tabular Anomaly Detection), a model-agnostic post-processing framework that enhances any existing TAD detector through sample-specific calibration. Our approach characterizes normal data via two complementary distributions, i.e., an empirical distribution from random sampling and a structural distribution from K-means centroids, and measures how adding a test sample disrupts their compatibility using Optimal Transport (OT) distance. Normal samples maintain low disruption while anomalies cause high disruption, providing a calibration signal to amplify detection. We prove that OT distance has a lower bound proportional to the test sample's distance from centroids, and establish that anomalies systematically receive higher calibration scores than normals in expectation, explaining why the method generalizes across datasets. Extensive experiments on 34 diverse tabular datasets with 7 representative detectors spanning all major TAD categories (density estimation, classification, reconstruction, and isolation-based methods) demonstrate that CTAD consistently improves performance with statistical significance. Remarkably, CTAD enhances even state-of-the-art deep learning methods and shows robust performance across diverse hyperparameter settings, requiring no additional tuning for practical deployment.

Calibrating Tabular Anomaly Detection via Optimal Transport

TL;DR

CTAD tackles the heterogeneity of tabular anomaly detection by proposing a model-agnostic, OT-based calibration framework. It treats normality through two complementary representations—a random empirical snapshot and a K-means structural view—and measures test-sample disruption via OT between these views. The approach comes with theoretical guarantees of a positive OT gap between anomalies and normals and shows consistent, statistically significant improvements across 34 datasets and 7 detectors, including state-of-the-art deep models, with negligible online overhead. As a drop-in post-processing step, CTAD offers robust, hyperparameter-insensitive gains without retraining, making it practical for real-world deployment.

Abstract

Tabular anomaly detection (TAD) remains challenging due to the heterogeneity of tabular data: features lack natural relationships, vary widely in distribution and scale, and exhibit diverse types. Consequently, each TAD method makes implicit assumptions about anomaly patterns that work well on some datasets but fail on others, and no method consistently outperforms across diverse scenarios. We present CTAD (Calibrating Tabular Anomaly Detection), a model-agnostic post-processing framework that enhances any existing TAD detector through sample-specific calibration. Our approach characterizes normal data via two complementary distributions, i.e., an empirical distribution from random sampling and a structural distribution from K-means centroids, and measures how adding a test sample disrupts their compatibility using Optimal Transport (OT) distance. Normal samples maintain low disruption while anomalies cause high disruption, providing a calibration signal to amplify detection. We prove that OT distance has a lower bound proportional to the test sample's distance from centroids, and establish that anomalies systematically receive higher calibration scores than normals in expectation, explaining why the method generalizes across datasets. Extensive experiments on 34 diverse tabular datasets with 7 representative detectors spanning all major TAD categories (density estimation, classification, reconstruction, and isolation-based methods) demonstrate that CTAD consistently improves performance with statistical significance. Remarkably, CTAD enhances even state-of-the-art deep learning methods and shows robust performance across diverse hyperparameter settings, requiring no additional tuning for practical deployment.
Paper Structure (34 sections, 24 equations, 4 figures, 9 tables, 1 algorithm)

This paper contains 34 sections, 24 equations, 4 figures, 9 tables, 1 algorithm.

Figures (4)

  • Figure 1: The two-distribution philosophy of CTAD. We construct an empirical distribution ${\bm{P}}$ by augmenting random reference samples from $\mathcal{D}_{train}$ with $\mathbf{x}_{test}$, and a structural distribution ${\bm{Q}}$ from K-means centroids of $\mathcal{D}_{train}$. Left: A normal test sample lies close to centroids, resulting in low OT distance and preserved compatibility. Right: An anomalous test sample is far from all centroids, resulting in high OT distance and disrupted compatibility. The dashed line illustrates the transport cost that $\mathbf{x}_{test}$ must pay to align with ${\bm{Q}}$.
  • Figure 2: Comparison of all models' performance across different datasets (AUC-PR). The red triangles represent the average value. CTAD with DRL as base detector achieves the SOTA performance.
  • Figure 3: Comparison with Alternative Calibration Methods across 34 datasets. CTAD consistently outperforms alternative calibration strategies including centroid distance, Mahalanobis distance, and OT-only approaches, demonstrating the effectiveness of our optimal transport-based calibration framework.
  • Figure 4: Hyperparameter ablation studies. Top: Effect of centroid count $K$. Middle: Effect of reference sample size $M$. Bottom: Effect of calibration weight $\lambda$.