Contextual and Seasonal LSTMs for Time Series Anomaly Detection
Lingpei Zhang, Qingming Li, Yong Yang, Jiahao Chen, Rui Zeng, Chenyang Lyu, Shouling Ji
TL;DR
CS-LSTMs address univariate time series anomaly detection by coupling a noise-decomposition preprocessor with a dual-branch prediction model that operates in time and frequency domains. The S-LSTM captures evolving seasonal patterns in the frequency domain, while the C-LSTM focuses on local contextual dynamics, both optimized with a noise-decomposed NLL loss. Empirical results on Yahoo, KPI, WSD, and NAB show state-of-the-art F1 scores and a ~40% reduction in inference time, with strong cross-domain transferability. The approach offers robust, efficient TSAD suitable for IT monitoring and similar applications, advancing detection of subtle point and slowly rising anomalies.
Abstract
Univariate time series (UTS), where each timestamp records a single variable, serve as crucial indicators in web systems and cloud servers. Anomaly detection in UTS plays an essential role in both data mining and system reliability management. However, existing reconstruction-based and prediction-based methods struggle to capture certain subtle anomalies, particularly small point anomalies and slowly rising anomalies. To address these challenges, we propose a novel prediction-based framework named Contextual and Seasonal LSTMs (CS-LSTMs). CS-LSTMs are built upon a noise decomposition strategy and jointly leverage contextual dependencies and seasonal patterns, thereby strengthening the detection of subtle anomalies. By integrating both time-domain and frequency-domain representations, CS-LSTMs achieve more accurate modeling of periodic trends and anomaly localization. Extensive evaluations on public benchmark datasets demonstrate that CS-LSTMs consistently outperform state-of-the-art methods, highlighting their effectiveness and practical value in robust time series anomaly detection.
