[Paper Review] A Comparative Study of Detecting Anomalies in Time Series Data Using LSTM and TCN Models
This study compares Long Short-Term Memory (LSTM) and Temporal Convolutional Network (TCN) models for anomaly detection in time series data using the SWaT water treatment testbed. TCN outperforms LSTM slightly in F1 score (0.920 vs. 0.901) and training stability, achieving optimal performance faster with less loss oscillation, demonstrating TCN's efficiency and robustness in anomaly detection tasks.
There exist several data-driven approaches that enable us model time series data including traditional regression-based modeling approaches (i.e., ARIMA). Recently, deep learning techniques have been introduced and explored in the context of time series analysis and prediction. A major research question to ask is the performance of these many variations of deep learning techniques in predicting time series data. This paper compares two prominent deep learning modeling techniques. The Recurrent Neural Network (RNN)-based Long Short-Term Memory (LSTM) and the convolutional Neural Network (CNN)-based Temporal Convolutional Networks (TCN) are compared and their performance and training time are reported. According to our experimental results, both modeling techniques perform comparably having TCN-based models outperform LSTM slightly. Moreover, the CNN-based TCN model builds a stable model faster than the RNN-based LSTM models.
Motivation & Objective
- To evaluate and compare the performance of LSTM and TCN models in detecting anomalies within time series data from IoT systems.
- To assess training efficiency, model stability, and prediction accuracy across both architectures under comparable complexity.
- To determine whether TCN-based models offer advantages over RNN-based LSTM models in terms of anomaly detection precision, recall, F1 score, and training time.
- To provide empirical evidence on the superiority of TCN over LSTM in real-world time series anomaly detection using a standardized testbed.
Proposed method
- Implemented a TCN model with three residual blocks and three hidden layers, using dilated causal convolutions to capture long-range temporal dependencies.
- Built an LSTM model with one and three hidden layers, using sequence-to-sequence reconstruction for anomaly detection via reconstruction error.
- Trained both models on the SWaT water treatment testbed dataset, which contains real industrial control system (ICS) data with labeled anomalies.
- Used binary cross-entropy loss for reconstruction and evaluated performance using precision, recall, and F1 score on the test set.
- Monitored validation loss during training to assess model convergence and stability, comparing oscillation patterns and convergence speed.
- Ensured fair comparison by matching model complexity (number of parameters and layers) and hyperparameters across both architectures.
Experimental results
Research questions
- RQ1How do TCN and LSTM models compare in terms of F1 score for anomaly detection in time series data?
- RQ2Which model achieves better training stability and convergence speed—TCN or LSTM—based on validation loss behavior?
- RQ3Does the TCN model require fewer training epochs to reach optimal performance compared to the LSTM model?
- RQ4How does the performance of TCN compare to that of the baseline GTA model in terms of precision, recall, and F1 score?
- RQ5What is the trade-off between model complexity and performance in TCN and LSTM architectures for time series anomaly detection?
Key findings
- The TCN model achieved an F1 score of 0.920, slightly outperforming the LSTM model with three hidden layers (F1 = 0.901) and the one-layer LSTM (F1 = 0.874).
- The TCN model demonstrated superior training stability, with a smoother and more consistent validation loss curve and less oscillation compared to the LSTM model.
- The TCN model reached optimal performance in fewer epochs, achieving near-optimal validation loss earlier than the LSTM model, indicating faster convergence.
- All three models (TCN, 1-layer LSTM, 3-layer LSTM) achieved precision above 0.94, indicating strong positive predictive power.
- The TCN model reported a recall of 0.903, outperforming both LSTM variants (0.819 for 1-layer, 0.864 for 3-layer), indicating better detection of actual anomalies.
- The TCN model significantly outperformed the GTA baseline model, which reported an F1 score below 0.840, while all TCN and LSTM models exceeded this threshold.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.