Anomaly Detection with Score Distribution Discrimination

Minqi Jiang, Songqiao Han, Hailiang HuangKDD 2023

Abstract

Traditional anomaly-informed detection methods often rely on fixed target scores or rigid margins to separate normal data from outliers. However, these approaches frequently suffer from a lack of adaptability, sensitivity to noise, and significant feature distortion. This paper introduces Overlap Loss, a novel approach that utilizes Kernel Density Estimation (KDE) to minimize the overlap between the probability distributions of normal and abnormal scores. By focusing on distribution discrimination rather than arbitrary targets, the method adaptively learns to distinguish outliers while preserving the fine-grained features of the original data. Experimental results across 25 real-world datasets demonstrate that Overlap Loss significantly outperforms state-of-the-art baselines, showing particular strength in detecting complex local and dependency-based anomalies.

Introduction

Anomaly detection (AD) is a critical task in domains ranging from fraud detection to medical diagnosis. Modern AD systems generally fall into two categories: unsupervised methods, which operate without labels, and anomaly-informed methods, which leverage a small set of known anomalies to guide the model. While anomaly-informed methods typically outperform unsupervised ones, they often rely on loss functions that force anomalies toward a specific score (e.g., 100) and normal data toward another (e.g., 0).

This "fixed target" approach introduces three major limitations. First, it lacks adaptability, as a fixed margin may not suit the varying scales of different datasets. Second, it is sensitive to noise; if training data is contaminated with unlabeled anomalies, forcing them toward a "normal" target confuses the model. Finally, it causes feature distortion, where forcing data into arbitrary score buckets breaks the underlying representation and loses valuable information. To address these issues, we propose a method that discriminates between score distributions rather than individual point targets.

Methodology: The Overlap Loss

The core contribution of this research is the Overlap Loss, a framework designed to minimize the intersection of score distributions for normal and abnormal samples. The method consists of two primary components:

1. Score Distribution Estimator

Instead of evaluating individual data points in isolation, the model employs Kernel Density Estimation (KDE) to estimate the global "shape" or Probability Density Function (PDF) of the scores for both normal and abnormal groups within a training batch. This allows the model to handle complex, non-linear distributions that fixed-margin losses cannot capture.

2. Overlap Area Calculation

The loss function identifies the intersection points of the estimated PDFs and calculates the area where they overlap. The optimization goal is to minimize this area. Crucially, the loss is bounded (ranging between 0 and 2) and enforces a correct order, penalizing the model heavily if it assigns higher anomaly scores to normal samples than to known anomalies. Because it does not rely on fixed targets, the model allows distributions to settle naturally where they best fit the specific dataset, preserving the integrity of the embedding space.

Experimental Setup

The effectiveness of Overlap Loss was evaluated using 25 diverse real-world datasets covering disease diagnosis (e.g., annthyroid), speech recognition (vowels), and image identification (mnist, optdigits). To further test the model's robustness, the researchers injected four types of synthetic anomalies:

  • Local Outliers: Samples that appear normal globally but are anomalous relative to their immediate neighbors.
  • Global Outliers: Samples far from the entire normal data distribution.
  • Clustered Outliers: Groups of anomalies that form their own small clusters.
  • Dependency Outliers: Samples where individual features are within normal ranges, but their specific combination is impossible.

Key Results and Insights

Performance and Architecture Agnosticism

The authors integrated Overlap Loss into several backbones, including MLP, AutoEncoder, ResNet, and Transformers. The MLP implementation (MLP-Overlap) outperformed popular baselines like DevNet by 7.75% and PReNet by 5.67% in AUC-PR (Area Under Precision-Recall Curve). The performance gains were even more pronounced in complex architectures; adding Overlap Loss to a ResNet improved AUC-PR by 56.30% compared to a standard ResNet baseline.

Feature Preservation and Stability

A striking finding is that Overlap Loss causes significantly less distortion in the data's embedding space compared to standard losses like Deviation or Ordinal loss. By avoiding fixed constants, the model retains "fine-grained" information, which is vital for downstream tasks. Furthermore, the bounded nature of the loss prevents "exploding gradient" issues, leading to more stable training and faster convergence.

Label Efficiency

In real-world scenarios, labeled anomalies are often scarce. Overlap Loss maintains a significant performance lead even when only 5% of true anomalies are labeled, proving its utility in data-scarce environments.

Conclusion

Overlap Loss represents a shift in anomaly detection from point-wise target matching to distribution-level discrimination. By utilizing KDE and minimizing distribution overlap, the method provides a more flexible, stable, and feature-preserving alternative to traditional margin-based losses. While the current implementation uses KDE, future work may explore more complex estimators like Gaussian Mixture Models (GMM) and investigate robustness against "inexact" or noisy supervision where labels themselves may be inaccurate.

Summary updated

BibTeX
@inproceedings{jiang2023anomaly,
  author = {Minqi Jiang and Songqiao Han and Hailiang Huang},
  title = {{Anomaly Detection with Score Distribution Discrimination}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2023},
}
Figure