Reconstruction-based Multi-Normal Prototypes Learning for Weakly Supervised Anomaly Detection

Zhijin Dong, Hongzhi Liu, Boyuan Ren, Weimin Xiong, Zhonghai WuarXiv 2024

Abstract

Anomaly detection is a crucial task in various domains. Most existing methods assume normal data clusters around a single central prototype, whereas real-world data often consists of multiple categories or subgroups. Furthermore, many methods assume all unlabeled samples are normal, despite the inevitable presence of anomalies. To address these issues, we propose MNPWAD, a novel anomaly detection framework that efficiently utilizes limited labeled anomalies. Our approach learns multi-normal prototypes to represent diverse subgroups using deep embedding clustering and contrastive learning. Additionally, we estimate the likelihood of each unlabeled sample being normal during training to improve encoder and prototype learning. Extensive experiments demonstrate that MNPWAD significantly outperforms state-of-the-art methods across various benchmark datasets.

Introduction

Anomaly detection identifies rare patterns that deviate from standard behavior. However, two primary hurdles limit current models: the "One-Size-Fits-All" fallacy and anomaly contamination. The former refers to the assumption that normal data forms a single cohesive cluster, which fails when "normal" behavior is multi-modal (e.g., different legitimate user activities). The latter occurs in weakly supervised settings where unlabeled data is assumed to be purely normal, leading to model confusion when hidden anomalies are present.

Comparison between single central prototype (a) and the proposed multi-normal prototypes (b).

As illustrated in Figure 1, a single prototype approach often results in false detections when normal data is distributed across multiple clusters. MNPWAD addresses this by learning $k$ distinct prototypes to capture the diversity of normal behavior.

Methodology

The MNPWAD framework consists of three integrated modules designed to handle complex distributions and noisy unlabeled data.

The architecture of the proposed MNPWAD framework, featuring Reconstruction, Multi-Normal Prototypes, and Unified Anomaly Scoring modules.

Reconstruction Learning Module

This module employs an encoder-decoder architecture ($\psi, \psi'$) to learn latent representations $z_i$. The reconstruction loss $\mathcal{L}_{recon}$ is designed to minimize error for normal samples while ensuring that labeled anomalies result in significantly higher reconstruction errors, thereby establishing a baseline for normality.

Multi-Normal Prototypes Learning Module

Instead of a single center, the model learns $k$ normal prototypes ($u_j$) using Deep Embedding Clustering. It utilizes a Student’s t-distribution to measure similarity between data points and these prototypes. To sharpen these clusters, Contrastive Learning ($\mathcal{L}_{con}$) is employed to pull normal samples toward their nearest prototype while pushing anomalies to the periphery. Crucially, the model calculates a weight $w_i$ for every unlabeled sample; samples far from all normal prototypes receive low weights, mitigating the impact of anomaly contamination.

Unified Anomaly Scoring Module

The final stage fuses reconstruction error, latent features, and prototype similarity into a single anomaly score via a scoring function $\phi$. This unified approach allows the model to detect anomalies that might be missed by looking at reconstruction or distance alone.

Experiments and Results

We evaluated MNPWAD on 15 benchmark datasets, including network security (UNSW-NB15, IoT-23), finance (Fraud Detection), and general tabular data (Census Income, Pendigits). In a weakly supervised setup with only 1% labeled anomalies, MNPWAD demonstrated superior performance:

  • Accuracy: MNPWAD achieved the best AUC-PR on 13 out of 15 datasets, with an average score of 0.642, significantly higher than the next best method (0.558).
  • Robustness: The average AUC-ROC reached 0.886, outperforming competitors like DevNet and RoSAS with high statistical confidence ($p < 0.001$).
  • Generalization: In tests where specific anomaly types were hidden during training, MNPWAD outperformed baselines by over 20% in AUC-PR, proving its ability to detect novel, unseen threats.

Conclusion

MNPWAD effectively addresses the limitations of traditional anomaly detection by modeling normal data as a collection of diverse prototypes and filtering noisy unlabeled samples. Its robust performance across various domains highlights its potential for real-world applications. Future research will focus on extending this framework to high-dimensional data types like images and videos and exploring more sophisticated feature extraction techniques.

Summary updated

BibTeX
@misc{dong2024reconstruction,
  author = {Zhijin Dong and Hongzhi Liu and Boyuan Ren and Weimin Xiong and Zhonghai Wu},
  title = {{Reconstruction-based Multi-Normal Prototypes Learning for Weakly Supervised Anomaly Detection}},
  year = {2024},
  eprint = {2408.14498},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.14498},
}
Figure