DCdetector: Dual Attention Contrastive Representation Learning for Time Series Anomaly Detection

Anomaly detection in time series plays a vital role across numerous application domains, where the goal is to pinpoint data points that deviate significantly from the expected temporal patterns. A central challenge in this task lies in learning representations that effectively separate normal and abnormal behaviors. While reconstruction-based approaches remain widely used, they are often susceptible to performance degradation due to the influence of anomalies during training, which can dominate the reconstruction loss. In contrast, contrastive learning offers an alternative by seeking embeddings that emphasize dissimilarity across instances. This paradigm naturally aligns with the objective of anomaly detection and provides a more robust foundation for representation learning in unsupervised settings. In this context, we introduce DCdetector, a contrastive learning framework that leverages a dual attention mechanism and a multi-scale design to encode time series data from multiple perspectives. Unlike traditional methods, DCdetector adopts a fully contrastive objective without reconstruction loss and introduces architectural asymmetry to simulate permutation variations, enabling the model to learn permutation-invariant representations that are highly sensitive to abnormal patterns. Empirical evaluations conducted on a variety of benchmark datasets demonstrate that DCdetector achieves superior performance compared to existing methods, confirming its effectiveness and generalizability in real-world time series anomaly detection scenarios.

DCdetector: Dual Attention Contrastive Representation Learning for Time Series Anomaly Detection | Litlas