Center-Aware Pairwise Learning for Deep Semi-Supervised Anomaly Detection
Abstract
Anomaly detection (AD) assists in identifying irregularities within data. Existing works have primarily focused on improving detection for seen anomalies. However, most AD methods struggle to effectively detect unseen anomalies, which are novel types absent in training data and deviate from learned patterns. In this paper, we propose the Center-Aware Pairwise Learning (CAPL) network to effectively capture discriminative patterns of anomalies. For the center-aware component, the network extracts a global center vector that encapsulates the representation of all samples. Center loss regularization is then employed to refocus and adjust the sample features, pulling normal samples closer to the center while pushing anomalies further away. The process enhances robustness against distribution shift, improving the detection of unseen anomalies. For pairwise learning, the network captures relational representations by feature embeddings from positive pairs (normal-normal) and negative pairs (normal-anomaly, anomaly-normal and anomaly-anomaly). This strategy enhances generalization by simultaneously learning various normal/anomalous patterns, mitigating overfitting to labeled anomalies. A comprehensive set of experiments is conducted on 7 benchmark datasets using 7 popular algorithms for comparison. The results show that CAPL significantly outperforms competing methods in detecting seen and unseen anomalies. Source codes are available at https://github.com/zhanghrswpu/CAPL