Introduction
Anomaly detection in time series is a critical task across domains, from industrial monitoring to healthcare. However, identifying anomalies is challenging because they are rare, diverse, and often hidden within unlabeled datasets. This paper introduces ADSL (Anomaly Detection with Shapelet-based Feature Learning), a novel unsupervised framework that learns to define "normality" by identifying representative local patterns, or shapelets, and isolating them within a compact decision boundary.
The Challenge: Unsupervised and Contaminated Data
Most existing anomaly detection methods rely on two problematic assumptions:
- Clean Training Data: Many models assume the training set is purely "normal." In practice, unlabeled data often contains undetected anomalies (contamination).
- Global Feature Reliance: Methods often use global statistics (mean, variance) which can miss subtle, local shape-based anomalies.
ADSL addresses these by learning local features (shapelets) directly from potentially "dirty" training data, providing a robust and interpretable solution.
Methodology: The ADSL Algorithm
The core of ADSL is the joint optimization of shapelet features and a modified Support Vector Data Description (SVDD) boundary.
Shapelet Learning
Instead of searching for existing subsequences, ADSL optimizes $K$ synthetic shapelets. Each time series is transformed into a $K$-dimensional vector where each entry represents the minimum distance between the time series and a specific learned shapelet.
Modified SVDD ($SVDD^*$)
Standard SVDD encloses data in a minimal-volume hypersphere. ADSL introduces a crucial modification: fixing the hypersphere center at the origin.
Because shapelet features are distances, they are non-negative. A "perfectly normal" time series that matches a shapelet exactly will have a distance of zero. By anchoring the center at the origin, the model naturally pulls normal data toward the zero-point while pushing anomalies outside the radius $R$.
Key Insights: Interpretability and Robustness
One of the primary advantages of ADSL is its interpretability. Unlike deep learning "black boxes," ADSL allows users to visualize the learned shapelets to understand what the model considers "normal" behavior.
As shown in the figure above, time series $T_i$ (green) contains patterns similar to the learned shapelets $S_1$ and $S_2$, placing it inside the decision boundary. Conversely, $T_j$ (red) lacks these patterns, resulting in larger distances that push it outside the boundary as an anomaly.
Evaluation and Results
The authors tested ADSL on 28 benchmark datasets from the UCR Time Series Classification Archive. To simulate real-world conditions, they contaminated training sets with anomaly rates of 0.1%, 1%, and 5%.
- Superior Accuracy: ADSL consistently outperformed state-of-the-art baselines, including PCA-based methods and simple shapelet extraction.
- Stability: The model's performance remained stable even as contamination increased, thanks to the use of slack variables in the objective function that allow the model to "ignore" training-set anomalies.
- Domain Versatility: The method proved effective across diverse data types, from ECG signals to sensor data, provided the data contains recurring local patterns.
Conclusion
ADSL represents a significant step forward in unsupervised anomaly detection. By combining the local feature extraction of shapelet learning with the geometric efficiency of an origin-centered SVDD, it provides a robust, interpretable, and highly accurate tool for monitoring complex time series data. Future work aims to extend this framework to multivariate time series and improve computational efficiency for massive datasets.
Summary updated