## 2 Literature Review  
The literature review covers sources on approaches in the field of water quality assessment. [PERSON] et al. studied ecology modeling for the sustainable development of the urban environment [5]. [PERSON] et al. studied the application of sensors for a wastewater treatment system [6]. [PERSON] et al. proposed multi-objective machine learning for a water quality monitoring system and addressed the problem of dataset imbalance [7]. A survey of machine learning methods applied to anomaly detection on drinking water quality data by [PERSON] et al. [8] contains a comprehensive overview of the drinking water quality monitoring problems. The provided statistics are as follows: 41% of the surveyed water utilities rely on manual water sample collection for analysis, and only 16% rely on automated collection. However, only 40% of them would like to have a real-time water quality monitoring system, and only 17% currently have it. It also provides an overview of traditional monitoring types (physical observation, laboratory analysis, portable detection devices) and the transition to wireless sensor networks. It gives a retrospective of research into machine learning methods to detect anomalies in drinking water quality data. [PERSON] et al. consider class imbalance and the missing data impact on the performance of learning algorithms in water quality anomaly detection problems. The paper [9] presents a retrospective study on this issue. [PERSON] et al. prove the weakness of RNN (recurrent neural network) and LSTM (long short-term memory) algorithms with data that have an imbalance problem [10]. [PERSON] and [PERSON] propose using the ensemble learning Synthetic Minority Oversampling Technique (SMOTEBoost) and Random UnderSampling--RUSBoost for problems with extreme imbalance coefficients [11]. [PERSON] et al. consider solving the problem of noisy data coming from the water composition monitoring sensors by wavelet transforms [12]. [PERSON] et al. present a successful implementation of an adaptive learning rate backpropagation neural network (ALBP) and a 2-step Isolation and Random Forest (2 sIRF) models in urban water supply systems in Norway [13]. [PERSON] et al. describe a system concept for collecting data by a hardware-software complex for wastewater composition automated control from pH/ORP (power of Hydrogen/Oxidation-Reduction Potential) sensors. The paper [14] proposes an approach for automatic wastewater discharge detection by binary classification. References [15; 16; 17; 18; 19] present the basic terms of anomaly detection tasks. In a general sense, an anomaly means a deviation from expected behavior. Anomaly detection is the task of detecting unusual patterns that do not correspond to expected behavior. The following types of anomalies in time series are identified [15]:  
* Point anomalies, when a single data instance is considered anomalous in relation to other data;
* Contextual anomalies, when a data instance is anomalous in a certain context;
* Collective anomalies, which occur as a sequence of time points when no normal data exist between the beginning and end of the anomaly. Anomaly detection methods, according to [16], are shown in Figure 2.  
Anomaly detection metrics are considered in [17, 18]. An overview of metrics by anomaly type and anomaly detection tasks is shown in Figure 3.  
The main problems in solving this class of tasks are the following:  
* Noisy data, missing values associated with the data transmission specifics from sensors;
* Unbalanced distribution of classes (imbalanced data), associated with the peculiarity of the event (rare and missed events);
* Unlabeled data related to the specifics of the wastewater excess contamination MPC monitoring (unlabeled data do not indicate whether the value is normal or abnormal due to the use of indirect rather than direct measurement sensors);
* Lack of metrics for solving tasks with unlabeled data.