# A One-Class-Based Supervision System to Detect Unexpected Events in Wastewater Treatment Plants
## 3 Experiments and Results
### Results  
**Autoencoder. ** The results achieved using Autoencoder classifiers are shown in Table 2. This technique shows a remarkable improvement in performance when the deviation percentage increases. In most cases, the best result corresponds to a configuration that considers 5% of the training set as anomalous. A common trend in all experiments consists of the use of a high number of neurons in the hidden layer, meaning that almost all variables are important to achieve the best classifier. **Gaussian Model. ** The Gaussian model results are shown in Table 3. This statistical technique leads to successful results with more than 95% of the F1-score in 9 out of 10 anomaly sets. The lowest value is achieved when the anomalies are generated by deviating only by 5% from the original value. In all cases, the anomalies are correctly classified (True Negative), with a really low number of situations in which a false alarm is set. In contrast to Autoencoder classifiers, an outlier percentage of 0% in the training set is the best possible configuration. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Dev** & \multirow{2}{*}{**Preproc**} & **Hidden Layer** & **OP (\%)** & **TP** & **TN** & **FP** & **FN** & **F1 (\%)** \\ \hline
5 & Zscore & 19 & 0 & 38.3 & 8.5 & 28.5 & 1.7 & 71.7 \\
15 & Zscore & 20 & 5 & 34.2 & 20.9 & 16.1 & 5.8 & 75.7 \\
25 & Zscore & 20 & 0 & 39.5 & 18.8 & 18.2 & 0.5 & 80.9 \\
35 & Zscore & 20 & 5 & 34.3 & 33.4 & 3.6 & 5.7 & 88.1 \\
45 & Zscore & 20 & 5 & 34 & 34.4 & 2.6 & 6 & 88.8 \\
55 & Zscore & 18 & 5 & 34.1 & 36.4 & 0.6 & 5.9 & 91.3 \\
65 & Zscore & 18 & 5 & 34.9 & 36.2 & 0.8 & 5.1 & 92.2 \\
75 & Zscore & 20 & 5 & 34 & 35.8 & 1.2 & 6 & 90.4 \\
85 & Zscore & 20 & 5 & 34.6 & 36.1 & 0.9 & 5.4 & 91.7 \\
95 & Zscore & 18 & 5 & 35.8 & 37 & 0 & 4.2 & 94.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Results and configuration for the best Autoencoder classifier depending on anomaly percentage deviation. **K-means. ** The results achieved using K-means classifiers are shown in Table 4. Although the performance improves as the deviation increases, the F1 performance is below 80% in all cases, with consequent worse results than those of Autoencoder and Gaussian classifiers. The proper number of clusters to divide the dataset does not follow a common trend, varying from 1 to 29. The most critical aspect consists of the false positives that start with 37 (100% of the anomalies labeled as normal instances) and finish with 12, which is an improvable value. **NCBoP. ** Table 5 summarizes the performance of NCBoP classifiers in the different experiments. As in the case of K-means, the F1-score does not exceed 80% in any configuration with a great number of anomalous instances classified as normal. The value of \(\lambda\) is 1.4 in 8 out of 10 cases, which means that an increment in the decision boundary leads to better results. However, when the deviation used to generate the anomaly is 5%, the decision boundary should be reduced. The number of projections does not follow a recognizable pattern, varying depending on the experiment. To understand the improvement of each algorithm with the percentage variation of COD_S, NH3_S, and NTK_S, Figure 8 represents the values of the F1-score for each technique. The Gaussian model approach is the best algorithm to detect test parameter deviations.