Transfer Learning for Anomaly Detection through Localized and Unsupervised Instance Selection

Vincent Vercruyssen, Wannes Meert, Jesse DavisAAAI 2020

Introduction

Anomaly detection is a critical yet challenging "needle in a haystack" problem. Traditionally, it relies on unsupervised learning, assuming that anomalies are simply data points residing in low-density regions. However, real-world data is often noisy; for instance, a rare but normal system maintenance event might appear anomalous to an unsupervised model, leading to costly false alarms.

While supervised learning—using labeled examples of "normal" versus "anomaly"—can mitigate these issues, labels are notoriously expensive and difficult to collect for rare events. This paper addresses a common middle-ground scenario: a target task with no labels and a related source task that is already labeled. The core challenge lies in Transfer Learning: how to effectively move labels from the source to the target when the datasets are not identical. Existing global alignment methods often fail in this context because a few outliers can "poison" the alignment, leading to incorrect label transfers.

The LOCIT Framework

The authors introduce LOCIT (Localized Instance-Transfer), a framework designed to boost anomaly detection by intelligently "borrowing" labeled data from related tasks. LOCIT operates in two distinct phases: localized transfer and hybrid scoring.

1. Localized Instance-Based Transfer

Unlike traditional methods that attempt to warp the entire source dataset to match the target globally, LOCIT focuses on local data distributions. It evaluates whether the area around a specific source point matches the area around the corresponding point in the target data.

  • Local Structure: For every source instance, the algorithm examines its $\psi$-nearest neighbors in both the source and target domains.
  • Similarity Metrics: Neighborhoods are compared using Location distance (differences in centroids) and Correlation distance (differences in the shape or orientation of data clusters).
  • The Filter: LOCIT employs an internal Support Vector Machine (SVM) trained on the target data to identify "good" local matches. Only source instances inhabiting similar local neighborhoods in the target domain are transferred.
Comparison of domain alignment: (A) Original source and target domains, (B) Suboptimal global transfer with CORAL, and (C) Correct localized transfer with LOCIT.

2. SSKNNO (Semi-Supervised k-Nearest Neighbor Outlier)

Once relevant labels are transferred, the framework utilizes a novel scoring method, SSKNNO, to classify target data. The anomaly score is a weighted combination of an unsupervised score (based on $k$-nearest neighbor distance) and a supervised score (derived from nearby transferred labels). A "Trust" weight ($W_l$) determines the balance: if a target point is in a region where transferred labels are plentiful and consistent, the model prioritizes them; otherwise, it reverts to the unsupervised score, ensuring graceful degradation.

Experimental Evaluation

The authors evaluated LOCIT using two primary approaches:

  1. Transfer Learning Benchmark: 56 unique source-target pairs derived from 12 multi-class datasets (e.g., Gas sensors, Satellite data).
  2. Real-World Water Usage: Data from three large retail stores over three years, aiming to detect leaks by transferring labels between locations with varying sizes and operating hours.

Key Results

  • Superior Performance: LOCIT achieved the best average AUROC rank across the 56-pair benchmark, significantly outperforming state-of-the-art methods like TCA, GFK, and CORAL.
  • Significant Gains: The method provided a >9% improvement in detection accuracy over purely unsupervised methods.
  • Real-World Robustness: In the retail water usage task, LOCIT outperformed or tied the best non-transfer baseline on 95% of the tasks, demonstrating its ability to handle context shifts between physical locations.
  • Label Efficiency: LOCIT remained competitive even when only 10% of the source data was labeled, highlighting its utility in sparse-label environments.

Key Insights and Conclusion

The success of LOCIT highlights that local beats global in anomaly detection transfer. Global alignment techniques are fragile because anomalies act as noise that skews the alignment. By focusing on local neighborhoods, LOCIT is robust to these distortions. Furthermore, its label-agnostic selection process prevents bias during the transfer phase.

While LOCIT shows great promise, future work may address its sensitivity to neighborhood size hyperparameters and its computational complexity in "Big Data" streams. Additionally, exploring heterogeneous transfer learning—where source and target domains use different sensor types—remains an open area for research.

Summary updated

BibTeX
@inproceedings{vercruyssen2020transfer,
  author = {Vincent Vercruyssen and Wannes Meert and Jesse Davis},
  title = {{Transfer Learning for Anomaly Detection through Localized and Unsupervised Instance Selection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.6068},
}
Figure