# Unsupervised Anomaly Detection for Time Series Data of Spacecraft Using Multi-Task Learning
## 4 Results and Discussion
### Results and Discussion  
We compared the findings of the proposed method with the existing alternatives in terms of P, R, and F1-score, for the different contamination ratios listed in Table 3. The proposed MTAD method outperformed the alternatives in each comparison test, proving its effectiveness. Specifically, MTAD exhibited the best performance as it captured the spatial and temporal correlations in the data, which is significant for discriminating normal values from anomalies. However, the alternative methods failed to do this. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Task**} & \multirow{2}{*}{**Layers**} & \multicolumn{3}{c}{**Hyper Parameters**} \\ \cline{3-5}  & & **Loss** & **Parameters** & **Value** \\ \hline \multirow{2}{*}{Task1} & LSTM (units = 32) & \multirow{2}{*}{Equation (12)} & \multirow{2}{*}{batch size} & \multirow{2}{*}{32} \\  & Dense (units = 8) & & & \\ \hline \multirow{6}{*}{Task2} & TCN (filters = 20, kernelsize = 20) & \multirow{6}{*}{Equation (15)} & \multirow{6}{*}{} \\  & Conv1D (filters = 8) & & & \\ \cline{1-1} \cline{3-5}  & Pooling (size = 8) & & & \\ \cline{1-1} \cline{3-5}  & UpSampling1D (size = 8) & & & \\ \cline{1-1} \cline{3-5}  & TCN (filters = 20, kernelsize = 20) & & & \\ \cline{1-1} \cline{3-5}  & Conv1D (filters = 8) & & & \\ \hline \multirow{6}{*}{Task3} & LSTM (units = 32) & \multirow{6}{*}{Equation (18)} & \multirow{6}{*}{} \\  & Dense (units = 30) & & & \\ \cline{1-1} \cline{3-5}  & RepeatVector (units = 8) & & & \\ \cline{1-1} \cline{3-5}  & LSTM (units = 32) & & & \\ \hline \multirow{6}{*}{Task4} & LSTM (units = 32) & \multirow{6}{*}{Equation (20)} & \multirow{6}{*}{optimizer} & Adam \\ \cline{1-1} \cline{3-5}  & LSTM (units = 32) & & & \\ \cline{1-1} \cline{3-5}  & Dense (units = 8) & & & \\ \hline iForest & / & / & n\_estimators & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: MTAD parameter settings. Figure 5 shows the original telemetry data in blue and the detected results in green. For the detected results, \"high\" and \"low\" values denote normal and anomalous results, respectively. The red dotted line indicates the time at which the failure occurred. It is apparent that our method consistently returned a \"low\" value when the exception occurred, which indicates that our method is sensitive to unexpected data samples. Note that individual false alarms were reported, as shown in Figure 6a, because some data errors existed in the test dataset. This outcome is reasonable because data errors are a kind of anomaly that must be handled appropriately. The performance of an unsupervised anomaly detection method depends on the ability of the method to learn data patterns well during the training process, without under- or overfitting. Therefore, we checked the fit of each task over the training and test datasets in Figure 6. Figure 6a,d show the prediction errors of Proxy Tasks 1 and 4, respectively, on the training and test datasets. Figure 6b,c show the reconstruction errors of Proxy Tasks 2 and 3, respectively. Clearly, none of the four proxy tasks was over- or underfitted; this was because of the shared representation of multiple tasks, which improved the model generalization. To verify the effectiveness of each task implemented in the proposed method, ablation experiments were performed on the dataset; the results are shown in Figure 7. In the figure, \"T1\", \"T2\", and \"T3\" indicate that only Proxy Tasks 1, 2, or 3 were implemented, respectively, and \"All\" indicates that all tasks were reserved. \"T1 + T2\" indicates that Proxy Tasks 1 and 2 were reserved, and other combinations have similar meanings. Note that, as the Task 4 input depends on the latent representations of Tasks 2 and 3, there is no separate \"T4\" result. The experiment results demonstrate that, with a greater number of proxy tasks, the F1-score improved accordingly. Furthermore, the simultaneous implementation of Tasks 1 and 4 further improved the model performance.