TL;DR
This paper introduces TSAP, a novel framework for unsupervised time series anomaly detection (TSAD) that automatically tunes the augmentation hyperparameters. By using a differentiable augmentation module and an unsupervised validation loss, TSAP effectively learns to identify anomalies without labeled data, outperforming existing state-of-the-art methods.
What Problem Does This Paper Address?
Detecting anomalies in time series data is crucial across many domains, from monitoring industrial equipment to identifying critical health events. Traditional methods often struggle with the diversity of anomaly types (spikes, trend shifts, etc.) and require labeled data, which is frequently unavailable. While self-supervised learning (SSL) offers a promising avenue for unsupervised TSAD by generating "pseudo-anomalies" through data augmentation, its performance is highly sensitive to the choice of augmentation strategy and its associated hyperparameters. Crucially, there's a lack of methods that can automatically tune these augmentation hyperparameters without relying on labeled data, leaving this critical aspect to manual, often suboptimal, selection. This paper addresses this gap by proposing a system that can autonomously discover the best augmentation strategy for a given time series anomaly detection task.
Methods
TSAP tackles the challenge of hyperparameter tuning in SSL-based TSAD through two core components:
- Differentiable Augmentation Module: Instead of using fixed augmentation functions, TSAP employs a neural network-based augmentation model. This model is designed to be differentiable with respect to its hyperparameters, allowing for gradient-based optimization. This means the system can learn how to best transform the input data to create effective pseudo-anomalies.
- Unsupervised Validation Loss: To guide the hyperparameter tuning without labels, TSAP uses a novel unsupervised validation loss. This loss function, based on the Wasserstein distance, measures the alignment between the augmented normal data and a portion of the unlabeled test data. By minimizing this loss, TSAP ensures that the generated pseudo-anomalies are representative of the actual anomalies present in the test set.
The overall TSAP framework operates in an iterative manner, alternating between a "detection phase" (training a detector model) and an "alignment phase" (updating the augmentation hyperparameters to minimize the validation loss). It also incorporates a grid search mechanism for selecting the discrete augmentation type (e.g., trend shift vs. spike).
Datasets
The paper evaluates TSAP on several datasets:
- PhysioNet Challenge dataset (2017): This dataset contains real-world ECG recordings. The authors created controlled TSAD tasks by manually injecting six types of anomalies (trend, extremum, amplitude, mean shift, frequency shift, and platform) with varying hyperparameters.
- CMU Motion Capture (MoCap) dataset: This dataset provides real-world signals from subjects performing activities like walking, jumping, and running. The authors used walking signals as normal data and jumping/running signals as anomalies, creating natural TSAD tasks where the anomaly type is not pre-defined.
Key Insights and Ideas
- Augmentation is Key, but Tuning is Hard: The paper strongly emphasizes that the effectiveness of SSL for TSAD hinges on the quality of data augmentation. However, finding the right augmentation strategy and its parameters is a significant challenge, especially without labels.
- End-to-End Auto-Tuning is Possible: TSAP demonstrates that it's feasible to automatically tune both discrete (anomaly type) and continuous (e.g., level, length) augmentation hyperparameters in an unsupervised manner. This removes the need for manual expert intervention.
- Wasserstein Distance for Alignment: The use of Wasserstein distance as a validation loss is a crucial innovation. It provides a robust measure of distributional alignment, which is more effective than simple point-wise metrics for capturing subtle time series anomalies.
- Discrete and Continuous Tuning Synergy: TSAP effectively combines a differentiable approach for continuous hyperparameter tuning with a grid search for discrete anomaly types, creating a comprehensive self-tuning system.
- Generalizability Across Anomaly Types: TSAP shows consistent performance across a wide range of anomaly types, including both abrupt (e.g., spikes) and subtle (e.g., trend shifts) anomalies, highlighting its versatility.
Key Results
- State-of-the-Art Performance: TSAP consistently outperforms established baselines, including traditional methods (OC-SVM, LOF, ARIMA, IF, MP) and other deep learning/SSL approaches (EncDec-LSTM, SR-CNN, USAD, TimeGPT, NeuTraL-AD), on all tested TSAD tasks.
- Best Average Rank: TSAP achieves the best average rank in terms of both F1 score and AUROC across the six TSAD tasks, indicating its superior overall detection capability.
- Effective Hyperparameter Learning: Qualitative results demonstrate TSAP's ability to accurately tune continuous hyperparameters (level, length) and select the correct discrete anomaly type, even in challenging scenarios with subtle anomalies. For instance, on PhysioNet C, TSAP correctly identifies the Trend anomaly type and tunes its parameters, leading to high detection performance.
- Robustness to Noise: The paper shows that TSAP's validation loss helps reject poorly aligned anomaly types, even when inliers are highly variable (e.g., in ECG data).
Limitations and Future Work
- Computational Cost: While TSAP automates tuning, the process can be computationally intensive, especially the grid search for discrete hyperparameters.
- Scalability to Multivariate Time Series: The current work focuses on univariate time series. Extending TSAP to handle multivariate time series, which are common in real-world applications, is a natural next step.
- Expanded Anomaly Catalog: The paper suggests expanding the set of supported anomaly types to further enhance TSAP's applicability.
- Handling Multiple Anomaly Types: Future work could explore how TSAP can be adapted to detect multiple different anomaly types simultaneously within a single dataset.
- Broader Domain Application: Testing TSAP on datasets from different domains beyond sensor data and motion capture could reveal its broader utility.
Summary updated