# Uncertainty-Aware Time Series Anomaly Detection
## 3 Proposed Approach
### Thresholding Mechanism
For each count of time series per dataset, the average length over time series is listed. Furthermore, it contains information about the average number of contiguous anomalies, the average number of abnormal points and the difficulty of the dataset according to relative contrast. #### 4.3.1 Benchmark Algorithms

We compare our approach LSTMAE-UQ to a row of other algorithms: Isolation Forest [52], Local Outlier Factor [53], HBOS [54], NormA [55], One-Class Support Vector Machine [56], PCA [57], Convolutional Neural Network [58], LSTM-AD [15], AE, AE-UQ and LSTMAE. All baseline algorithms are implemented and accessible via the TSB-UAD ([[https://github.com/TheDatumOrg/TSB-UAD](https://github.com/TheDatumOrg/TSB-UAD)]([https://github.com/TheDatumOrg/TSB-UAD](https://github.com/TheDatumOrg/TSB-UAD)) (accessed on 1 September 2024)). #### 4.3.2 Results

Figure 11 gives an overview of the results of the benchmark per algorithm for the four selected metrics AUC, precision, recall and F-score. For this representation, the performance results of all of the 1980 time series are taken into account. The proposed algorithm is in each plot on the right, highlighted in blue. The plots show that LOF or Isolation Forest generally outperform the proposed LSTMAE-UQ method in terms of AUC, precision, recall, and F1-Score across multiple datasets. However, there are certain use cases for the proposed method in specific scenarios. Moreover, traditional anomaly detection algorithms, such as LOF (Local Outlier Factor) and Isolation Forest, lack interpretability when explaining the reason behind anomalies becomes crucial. Consequently, traditional methods may have difficulties adapting to the inherent uncertainties in time series data, which can lead to missed anomalies or a higher rate of false positives in certain scenarios. In contrast, LSTMAE-UQ is designed to address \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Dataset** & **Count** & **Average Length** & **Average \# Anomalies** & **Average \# of Abnormal Points** & \(R_{c}\) \\ \hline Daphnet [37] & 45 & 21,760.0 & 7.6 & 2841.0 & 2.38 \\ \hline Dodgers [38] & 1 & 50,400.0 & 133.0 & 5612.0 & 2.02 \\ \hline ECG [39] & 52 & 230,351.9 & 195.6 & 15,634.0 & 8.33 \\ \hline Genesis [40] & 6 & 16,220.0 & 3.0 & 50.0 & 2.28 \\ \hline GHL [41] & 126 & 200,001.0 & 1.2 & 388.8 & 27.24 \\ \hline IOPS & 58 & 102,119.2 & 46.5 & 2312.3 & 3.33 \\ \hline KDD21 [42] & 250 & 77,415.06 & 1 & 196.5 & 10.67 \\ \hline MGAB [43] & 10 & 100,000.0 & 10.0 & 200.0 & 27.64 \\ \hline MITDB [44] & 32 & 650,000.0 & 210.1 & 72,334.3 & 7.19 \\ \hline NAB [45] & 58 & 6301.7 & 2.0 & 575.5 & 2.67 \\ \hline NASA-MSL [46] & 27 & 2730.7 & 1.33 & 286.3 & 1.97 \\ \hline NASA-SMAP [46] & 54 & 8066.0 & 1.26 & 1032.4 & 4.18 \\ \hline Occupancy [47] & 10 & 5725.8 & 18.3 & 1414.5 & 2.5 \\ \hline OPPORTUNITY [48] & 465 & 31,616.9 & 2.0 & 1267.3 & 2.94 \\ \hline SensorScope [49] & 23 & 27,038.4 & 11.2 & 6110.4 & 2.38 \\ \hline SMD [21] & 281 & 25,562.3 & 10.4 & 900.2 & 3.39 \\ \hline SVDB [50] & 115 & 230,400.0 & 208.0 & 27,144.5 & 7.14 \\ \hline YAHOO [51] & 367 & 1561.2 & 5.9 & 10.7 & 3.25 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Summary characteristics of the 18 benchmark datasets in TSB-UAD. The \(R_{c}\) value measures the separability of a point to the other points. both aleatoric uncertainty, which captures noise in the data, and epistemic uncertainty, which reflects model uncertainty. Comparing the LSTMAE to its baselines LSTM and AE we note a couple of things. First compared to LSTM, we notice a superior median AUC. Medians of precision, recall and F-score are a bit lower, but the upper bound of the box is always higher. Secondly, compared to AE, performance is mostly similar over all metrics. Evaluating the performance of our LSTMAE-UQ, we can see that the model shows rather well results for the AUC value. With a median of 0.60 it is comparable to OCSVM, POLY, or the baseline LSTM with a higher variability of results. Compared to its direct baseline, the LSTMAE, we notice a decrease in median AUC.