# A One-Class-Based Supervision System to Detect Unexpected Events in Wastewater Treatment Plants
## 3 Experiments and Results
### Experiment Setup  
As stated in previous sections, an initial dataset corresponding to normal working operations is used to train one-class classifiers. Then, unexpected and undesired data are introduced into those classifiers to determine whether they are capable of detecting hazardous situations. The severity of the anomalous event is checked with the aim of evaluating the classifier's sensitivity. The percentage deviation is swept from 5 % to 95 % with a 10 % step. As no information about those anomalies is available during the training process, it is not feasible to apply feature selection techniques to evaluate the importance of each input variable in the classification process, so all variables are considered. In this sense, using an Autoencoder can contribute to reducing data dimension, compressing the data, and identifying sub-spaces with better performance.  
To implement the best classifier for each type of anomaly, the experiments are configured according to the following parameters:  
* Autoencoder: the input data of the neural network are comprised of the 23 variables monitored in the WWTP. The system is trained to learn the patterns from normal operation and replicate, at the output, the same value as the input. Once the model is trained, anomalous instances replicate the data at the output with significant error. This error, known as the reconstruction error, is the criteria to determine the anomaly detection. The number of layers is swept from 1 to 22, which is the number of variables  
Figure 7: Example of NCBoP for one-class techniques in \(\mathbb{R}^{3}\).  
minus one. The possibility of considering a percentage of anomalous points (OP) in the training set is checked: 0%, 5%, 10%, and 15%.
* Gaussian Model: the regularization parameter is swept from 0 to 0.005 with a step of 0.001. The possibility of considering a percentage of anomalous points (OPs) in the training set is checked: 0%, 5%, 10%, and 15%.
* K-means: the number of clusters is swept from 1 to 30. The possibility of considering a percentage of anomalous points (OPs) in the training set is checked: 0%, 5%, 10%, and 15%.
* NCBoP: the projections \(\pi\) tested are 10, 50, 100, 500 and 1000. Furthermore, the \(\lambda\) parameter in charge of reducing and expanding the boundaries is set to 0.6, 0.8, 1, 1.2, and 1.4.  
All these configurations are tested through a five K-fold cross-validation process with three different data preparation methods: no preparation, Z-score, and 0-1 normalization. The mean values of the confusion matrix components during the five folds are registered. Furthermore, the F1-score parameter (%) is also included since it is an underscored metric in the field of anomaly detection, particularly in evaluating classifier ability to detect irregularities in complex systems [43; 44]. To ensure classifier robustness, three aspects are taken into consideration:  
* The instances converted to anomalies are randomly selected from the initial dataset.
* From each selected instance, the variable modified is also randomly selected.
* The process is repeated following K-fold cross-validation, ensuring that all data are subjected to both training and test phases.