Can We Predict kNN-Based Anomalous Sound Detection Performance from Embedding-Space Geometry?

Wilkinghoff, Kevin, Tan, Zheng-Hua

–arXiv.org Artificial Intelligence 

ABSTRACT Anomaly detection systems are often trained using normal data alone, while model selection and evaluation typically require labeled anomalies. We study anomalyfree selection for k-nearest neighbor (kNN)-based anomaly detectors operating on embedding spaces, using pretrained audio representations and temporal pooling for first-shot industrial anomalous sound detection as a practically relevant application. We derive a lower bound on the area under the ROC curve (AUC) at the score level and use it to analyze kNN-based detection, relating score variability to the geometry of the embedding space. Under a local scaling model, we characterize how density variation, intrinsic-dimensional heterogeneity, and cross-domain mismatch contribute to inlier-score variability, and show how local density-based score normalization (LDN) affects these contributions. We then investigate anomaly-free model selection and show that inlier score variance alone does not reliably predict performance across different representations. To address this limitation, we introduce simple pseudo-anomaly probes that provide a reference for estimating relative score separation. Experiments on the DCASE 2022-2025 benchmarks, spanning four pretrained audio encoders and 208 candidate systems evaluate both kNN and LDN. The results show that LDN improves detection performance, while pseudo-anomaly-based estimators substantially improve anomaly-free model selection. The AUCBound provides robust selection across pseudo-anomaly constructions, and a simple metadata-free construction offers a competitive alternative to existing approaches, even outperforming conventional development-set selection when combined with LDN. 1 INTRODUCTION Anomalies are often unavailable for training because they are rare, diverse, and difficult to obtain. Consequently, many anomaly detection systems rely on normal data alone for training (Chandola et al., 2009; Pang et al., 2022; Ruff et al., 2018). However, model selection, hyperparameter tuning, and evaluation typically rely on labeled anomalies to assess detection performance.