CARLA: Self-supervised Contrastive Representation Learning for Time Series Anomaly Detection

Zahra Zamanzadeh Darban,Geoffrey I. Webb,Shirui Pan,Charu C. Aggarwal,Mahsa Salehi
2024-08-08
Abstract:One main challenge in time series anomaly detection (TSAD) is the lack of labelled data in many real-life scenarios. Most of the existing anomaly detection methods focus on learning the normal behaviour of unlabelled time series in an unsupervised manner. The normal boundary is often defined tightly, resulting in slight deviations being classified as anomalies, consequently leading to a high false positive rate and a limited ability to generalise normal patterns. To address this, we introduce a novel end-to-end self-supervised ContrAstive Representation Learning approach for time series Anomaly detection (CARLA). While existing contrastive learning methods assume that augmented time series windows are positive samples and temporally distant windows are negative samples, we argue that these assumptions are limited as augmentation of time series can transform them to negative samples, and a temporally distant window can represent a positive sample. Our contrastive approach leverages existing generic knowledge about time series anomalies and injects various types of anomalies as negative samples. Therefore, CARLA not only learns normal behaviour but also learns deviations indicating anomalies. It creates similar representations for temporally closed windows and distinct ones for anomalies. Additionally, it leverages the information about representations' neighbours through a self-supervised approach to classify windows based on their nearest/furthest neighbours to further enhance the performance of anomaly detection. In extensive tests on seven major real-world time series anomaly detection datasets, CARLA shows superior performance over state-of-the-art self-supervised and unsupervised TSAD methods. Our research shows the potential of contrastive representation learning to advance time series anomaly detection.
Machine Learning,Neural and Evolutionary Computing
What problem does this paper attempt to address?
The paper primarily addresses a core challenge in Time Series Anomaly Detection (TSAD) — the lack of labeled data in many real-world scenarios. Specifically, the paper aims to solve the following key issues: 1. **The problem of lacking labeled data**: Most existing anomaly detection methods focus on learning the normal behavior of unlabeled time series in an unsupervised manner. However, in real-world applications, it is often difficult to obtain sufficient labeled data to clearly distinguish between normal and abnormal behavior. 2. **Overly tight definition of normal boundaries**: Existing methods typically define a relatively strict normal range, leading to slight deviations being incorrectly classified as anomalies. This results in a high false positive rate and limits the generalization ability to normal patterns. To address the above issues, the paper proposes a novel end-to-end self-supervised contrastive representation learning framework named CARLA (ContrAstive Representation Learning for Anomaly detection). The main contributions of CARLA include: - **Contrastive representation learning**: CARLA injects various types of anomalies into the time series as negative samples by leveraging existing general knowledge about different types of time series anomalies. This allows it to learn not only normal behavior but also deviations indicative of anomalies. - **Self-supervised classification**: To ensure that the representations of existing real anomaly windows are different from those of normal windows, CARLA adopts a self-supervised approach to classify time series windows based on their nearest/farthest neighbors in the feature representation space. Through extensive testing on 7 major real-world TSAD datasets, CARLA has shown superior performance compared to existing self-supervised, semi-supervised, and unsupervised TSAD methods. The study highlights the great potential of contrastive representation learning in advancing the TSAD field, paving the way for novel applications and deeper exploration.