# Uncertainty-Aware Time Series Anomaly Detection
###### Abstract  
Traditional anomaly detection methods in time series data often struggle with inherent uncertainties like noise and missing values. Indeed, current approaches mostly focus on quantifying epistemic uncertainty and ignore data-dependent uncertainty. However, consideration of noise in data is important as it may have the potential to lead to more robust detection of anomalies and a better capability of distinguishing between real anomalies and anomalous patterns provoked by noise. In this paper, we propose LSTMAE-UQ (Long Short-Term Memory Autoencoder with Aleatoric and Epistemic Uncertainty Quantification), a novel approach that incorporates both aleatoric (data noise) and epistemic (model uncertainty) uncertainties for more robust anomaly detection. The model combines the strengths of LSTM networks for capturing complex time series relationships and autoencoders for unsupervised anomaly detection and quantifies uncertainties based on the Bayesian posterior approximation method Monte Carlo (MC) Dropout, enabling a deeper understanding of noise recognition. Our experimental results across different real-world datasets show that consideration of uncertainty effectively increases the robustness to noise and point outliers, making predictions more reliable for longer periodic sequential data. Keywords:anomaly detection; time series; uncertainty quantification; deep neural networks; bayesian network +
Footnote †: journal:  
_Article_  
Uncertainty-Aware Time Series Anomaly Detection [PERSON], [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON] Uncertainty-Aware Time Series Anomaly Detection F..  
aleatoric uncertainty helps the model handle noise, reducing the risk of false positives by distinguishing random fluctuations from true anomalies. On the other hand, acknowledging epistemic uncertainty informs decision-makers about the model's confidence levels, which is particularly vital in critical domains such as healthcare and IoT, where precise assessments of anomaly detection results are essential. By quantifying these uncertainties, we can guide practitioners in determining whether additional data or model adjustments are necessary to enhance the reliability of detections. Addressing uncertainty in anomaly detection requires advanced approaches [3], such as Bayesian methods [4] or ensemble learning [5], which offer promising avenues for capturing and quantifying uncertainty in time series data. These techniques provide probabilistic assessments of anomalies, enabling decision-makers to gauge the reliability of detection results and prioritize response efforts accordingly. Traditional anomaly detection techniques [6] struggle to adapt to these uncertainties, leading to either missed anomalies or a high rate of false positives. In this work, we explore a way to consider both aleatoric and epistemic uncertainties for anomaly detection in time series data. Based on existing works [7; 8], our approach constructs an Autoencoder based on LSTM (Long Short-Term Memory) [9] for accurate time-series modeling [10]. Autoencoders are a well-established architecture for unsupervised anomaly detection. LSTMs foster an understanding of the complex relations in time series. The combination aims to learn normal behavior in data to be able to distinguish it from anomalous data. Further, we implement a solution for separate aleatoric and epistemic uncertainty quantification. Using a multi-layer neural network structure, we approach epistemic uncertainty quantification using the Bayesian posterior approximation method Monte Carlo (MC) Dropout [11]. For aleatoric uncertainty, a split head of the autoencoder architecture separately predicts per-point aleatoric uncertainty trained by a modified loss function. By combining these approaches into one model, we want to evaluate uncertainty quantification capabilities and its efficiency in univariate time series data. We argue that involving uncertainty supports the anomaly detection process to achieve more precise predictions.