# Uncertainty-Aware Time Series Anomaly Detection
## 3 Proposed Approach
### Thresholding Mechanism
Continuing with the evaluation of the LSTMAE-UQ model, notable observations include a relatively robust AUC value. However, precision stands out as relatively stronger in comparison to recall and F-score, although all metrics remain relatively low. This suggests that the model possesses a comparably good understanding of classes, and if it identifies an anomaly, the likelihood of it being a true anomaly is relatively high. Nevertheless, the algorithm shows shortcomings in accurately identifying the anomaly. Figure 13: Performance evaluation of the LSTM Autoencoder with uncertainty quantification split up according to anomaly type. Sequence (short) is defined as a sequence up to 10 data points, Sequence (long) contains all sequences longer than 10 points. A comparison between LSTMAE-UQ and the baseline LSTMAE reveals a decrease in performance across all metrics. Diving deeper into the details, this decline can be led back to a particular anomaly type. While no significant difference is observed for longer sequence anomalies, the model shows shortcomings in detecting short sequence and point anomalies in comparison to its baseline. The reason for that could be consideration of uncertainty in the model. Consideration of uncertainty makes the model count point anomalies as well as short sequences deviating from normal patterns as noise and learns to ignore them. This hypothesis finds support in the findings of the experiment about the behavior of uncertainty during anomalies, where the impact of anomalies, especially for longer input windows, remains low for point anomalies. Adjusting sensitivity and window size could enhance the model's robustness across all anomaly types. In the overall picture, the presented algorithm is in the median to lower performance realm. Previously discovered properties explained this result. However, it might find application in areas where noise in data should be explicitly considered or where short and point anomalies are intentionally disregarded. ## 5 Conclusions

This work introduces LSTMAE-UQ, a novel approach in this work, we developed the LSTMAE-UQ approach to time series anomaly detection under uncertainty. Different from previous approaches, this work takes into consideration both types of uncertainty, aleatoric and epistemic based on the Bayesian posterior approximation method Monte Carlo (MC) Dropout. Experiments conducted on synthetic and real datasets emphasize the need for nuanced approaches in anomaly detection, taking into account the complex interplay between noise, anomalies, and model uncertainty. In future work, we plan to compare LSTMAE-UQ with other uncertainty quantification methods. We are also particularly interested in investigating LSTMAE-UQ's performance in real-world data streams and exploring methods to quantify uncertainty specifically tailored for the IoT environment, considering factors like sensor noise and data transmission errors. Another key perspective for future work is to improve the interpretability of LSTMAE-UQ's uncertainty outputs. Currently, the model assigns uncertainty values to data points, but we lack a clear understanding of why the model assigns higher uncertainty to specific instances. By investigating methods to make these uncertainties more interpretable, we could gain valuable insights into the model's reasoning process. This interpretability would be crucial for building trust in LSTMAE-UQ's predictions. With a clearer understanding of the uncertainties, users could not only rely on the anomaly detection results but also understand the rationale behind the model's decisions. This is particularly important in safety-critical applications where justifying model outputs is essential. **Author Contributions:** Conceptualization, P.W. ; methodology, P.W., G.B., S.S. and R.C. ; software, P.W. ; validation, P.W. ; formal analysis, P.W., S.S. and R.C. ; investigation, P.W. ; resources, P.W. ; data curation, P.W. ; writing--original draft preparation, P.W. ; writing--review and editing, P.W., G.B., S.S., R.C. and H.-J.B.; visualization, P.W.