Mind the Gap: Detecting Cluster Exits for Robust Local Density-Based Score Normalization in Anomalous Sound Detection

Kevin Wilkinghoff, Gordon Wichern, Jonathan Le Roux, Zheng-Hua Tan · DOI

Abstract

Local density-based score normalization is an effective component of distance-based embedding methods for anomalous sound detection, particularly when data densities vary across conditions or domains. In practice, however, performance depends strongly on neighborhood size. Increasing it can degrade detection accuracy when neighborhood expansion crosses cluster boundaries, violating the locality assumption of local density estimation. This observation motivates adapting the neighborhood size based on locality preservation rather than fixing it in advance. We realize this by proposing cluster exit detection, a lightweight mechanism that identifies distance discontinuities and selects neighborhood sizes accordingly. Experiments across multiple embedding models and datasets show improved robustness to neighborhood-size selection and consistent performance gains.

Introduction

In Anomalous Sound Detection (ASD), the goal is to identify when a machine sounds "wrong" using only examples of "normal" operation. Modern systems do this by mapping audio to a high-dimensional "embedding space" where similar sounds sit close together. To handle domain shifts (e.g., a machine recorded in a noisy factory vs. a quiet lab), researchers use Local Density-Based Score Normalization (LDN). LDN adjusts an anomaly score based on the density of its $K$ nearest neighbors.

The Locality Problem

LDN faces a significant challenge in neighborhood size selection. If the neighborhood size ($K$) is too small, the density estimate is noisy and unstable. Conversely, if $K$ is too large, the neighborhood expands past the local "cluster" of similar sounds into unrelated data. This violates the "locality assumption," causing detection accuracy to plummet. Currently, most researchers set $K$ to a very small, safe value (like 1 or 2), which limits potential performance gains.

Sorted distances and distance ratios showing cluster exits.

As shown in the figure above, distances to neighbors ($d_k$) do not increase uniformly. Sudden "jumps" in distance, reflected as sharp drops in the ratio $r_k = d_k/d_{k+1}$, indicate that the neighborhood has exited the local cluster. These "cluster exits" occur much earlier in target domains (new environments) than in source domains, explaining why fixed-size neighborhoods often fail under domain shift.

Cluster Exit Detection (CED)

The proposed Cluster Exit Detection (CED) is a plug-and-play mechanism that allows $K$ to be large by default but "trims" it on a per-sample basis when it detects a cluster boundary.

  1. Distance Ratios: The algorithm monitors the ratios between distances of consecutive neighbors.
  2. Adaptive Truncation: It identifies the most significant "drop" in these ratios to find the most likely cluster exit point.
  3. Data-Adaptive Thresholding: To ensure robustness, it uses the 4th percentile of ratio sequences as a threshold to decide where to cut off the neighborhood expansion.
  4. Conservative Fallback: If the data is very sparse, the system defaults to a small neighborhood ($K=2$).

Crucially, this method is training-free and requires no manual tuning for specific datasets.

Experimental Evaluation

The method was evaluated on five major benchmarks from the DCASE Challenges (2020-2025), covering various industrial machines across different operating conditions. To ensure model-agnosticism, CED was tested with five different embedding models: Direct-ACT (task-specific), and four large-scale pre-trained models (OpenL3, BEATs, EAT, and Dasheng).

Key Results and Robustness

The primary advantage of CED is its robustness to the initial choice of $K$. While standard LDN performance crashes as $K$ increases beyond 2, LDN+CED remains stable and high-performing even when the initial $K$ is set as high as 512.

Performance stability of LDN+CED across neighborhood sizes K for the BEATs model.

CED provided consistent improvements over the standard $K=2$ baseline across almost all datasets and models. For instance, on the DCASE2023 dataset, CED improved average performance by up to +0.32%, with single-split improvements reaching +1.39%. The benefits were observed regardless of the underlying embedding architecture.

Conclusion

Cluster Exit Detection addresses a structural failure in local density estimation by preserving locality. By acting as a safety valve for neighborhood expansion, CED enables the use of larger, more stable neighborhoods without the risk of crossing cluster boundaries. This training-free, model-agnostic approach significantly improves the robustness and accuracy of anomalous sound detection systems.

Summary updated

Abstract

Local density-based score normalization is an effective component of distance-based embedding methods for anomalous sound detection, particularly when data densities vary across conditions or domains. In practice, however, performance depends strongly on neighborhood size. Increasing it can degrade detection accuracy when neighborhood expansion crosses cluster boundaries, violating the locality assumption of local density estimation. This observation motivates adapting the neighborhood size based on locality preservation rather than fixing it in advance. We realize this by proposing cluster exit detection, a lightweight mechanism that identifies distance discontinuities and selects neighborhood sizes accordingly. Experiments across multiple embedding models and datasets show improved robustness to neighborhood-size selection and consistent performance gains.
BibTeX
@misc{wilkinghoff2026mind,
  author = {Kevin Wilkinghoff and Gordon Wichern and Jonathan Le Roux and Zheng-Hua Tan},
  title = {{Mind the Gap: Detecting Cluster Exits for Robust Local Density-Based Score Normalization in Anomalous Sound Detection}},
  year = {2026},
  eprint = {2602.18777},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.18777},
}
Figure