ANALYSIS OF THE ACTIVATED SLUDGE COMPOSITION USING ARTIFICIAL NEURAL NETWORKS

The object of research is electron microscopic images of activated sludge, which were used to train a convolutional neural network. An important task of the process of biological wastewater treatment is the prompt determination of quantitative and qualitative changes in activated sludge, as well as the assessment of the impact of the identified changes on the efficiency of the treatment. Microscopic examination, which is a traditional tool for controlling the quality of the water-sludge mixture, does not allow to quickly detect the deterioration of the activated sludge, which can lead to its degradation, and in difficult cases – to the death of the sludge. Violation of the microbiological composition of sludge leads to improper formation of flocs, violation of the process of formation of flakes, filamentous or sludge swelling, toxicity, etc. The combination of artificial intelligence methods with existing methods of quality control of activated sludge will increase the reliability and validity of the assessment of the quality of biological treatment. A proposed methodology for analyzing the state of activated sludge using convolutional neural networks. For the purpose of training the network, images of activated sludge were prepared, which were classified into two categories – «flocs» and «bacteria with microorganisms». There are 4 subcategories in the «flocks» category: size, shape, structure, edge of the floc; in the category «bacteria with microorganisms» there are 2 subcategories: «individual bacteria and microorganisms» and «colonies». Data sets of 250, 500 and 1000 images were created for each category. The task of learning the image processing model and the criteria for evaluating the success of learning are formulated. The task of training the network was to find such a recognition function that, with a given degree of accuracy, approximates the unknown recognition function over the entire domain of its definition. The accuracy of image recognition is chosen as a learning success criterion. The model training results show that the image recognition accuracy reaches 99.98 %, and the training quality is affected by the sample size and training duration. The trained model can be used as a fast and efficient tool to detect problems with activated sludge.


Introduction
Biological wastewater treatment using activated sludge is used in Ukraine at most urban sewage treatment plants.As a result of the decomposition of organic pollutants by activated sludge microorganisms, flocs are formed, which easily settle and the deposits are removed at the settling stage [1].The quality of activated sludge is influenced by the technological and hydraulic conditions of the process, as well as the state and composition of the biota.For example, work [2] shows that pH values lower than 4.5 in combination with a temperature of 15 °C reduce the number of most microorganisms present in the investigated sludge samples.The research results given in [3] indicate the negative impact of a short-term decrease in the amount of dissolved oxygen on activated sludge microorganisms, and in [4] it is shown that aeration of the water-sludge mixture in an aeration tank with oxygen or air intensifies the cleaning process.The issue of intensification of the municipal wastewater treatment process is also considered in [5].
A significant problem is the entry of toxic effluents into the sewage network, such as diesel fuel or water from washing trucks.Such effluents lead to poisoning or even death of the microbiome: the author of [6] noted that approximately 10 % of activated sludge plants in Colorado faced the problem of toxic effluents during the year.At the same time, the use of vacuum disintegration [7] activates the process of biological hydrolysis and minimizes the amount of excess sludge.The formation of granulated sludge [8] improves its sedimentation properties, provides the necessary degree of purification and low biomass yield.The processes of formation of flocs and sedimentation of biomass are affected by the shape and growth rate of microorganisms, as well as the amount of nutrients [6].Therefore, controlling the quality of activated sludge is an important and urgent task of managing the process of biological wastewater treatment.
Microscopic examination is a well-known tool for determining the condition of activated sludge, as well as the reasons that lead to a decrease in sludge efficiency.The deve lopment of neural networks allows the application TECHNOLOGY AUDIT AND PRODUCTION RESERVES -№ 2/3(70), 2023 ISSN 2664-9969 of artificial intelligence methods to the analysis and forecasting of the quality of activated sludge.Unlike specialized software, which is used to solve narrowly focused problems, for exam ple [9], neural networks can be applied to identify patterns among a large amount of raw data.Deep reinforced learning models proposed by the authors of [10] are used to predict the amount of wastewater entering the sewage treatment plant in Busan (Republic of Korea), as well as to optimize the control of the pumping systems of the specified water treatment plant.
In [11], a review of neural networks used for controlling activated sludge plants was carried out.Networks based on deep learning models such as «reinforcement learning» or «long short-term memory» have been shown to be effectively used to predict and plan cleaning processes.However, these networks require large amounts of machine memory, so they cannot be recommended for low-performance computing systems.
Image processing models are promising for evaluating the state of activated sludge on magnified images of wastewater; such models are the most efficient in terms of computational complexity.The authors of the paper [12] proposed a technique that uses convolutional neural networks to classify soils, silt, and sand based on field research data, as well as images obtained through a geographic information system and remote sensing.Considering the above, the application of image processing models to study the state of activated sludge in order to assess the quality of sludge is an extremely urgent task.
The purpose of this study is to define a methodology for analyzing the state of activated sludge using convolutional neural networks.The use of artificial intelligence methods as a supplement to the existing methods of quality control of activated sludge will increase the reliability of managing the process of biological wastewater treatment.

Materials and Methods
The object of research is electron microscopic images of activated sludge, which were used for training a convolutional neural network.
Images of activated sludge are divided into two categories -flocs and bacteria with microorganisms.Each category contains 3 to 5 subcategories, as shown in Fig. 1.
The training sample consists of a set of images of active sludge according to defined categories: Fig. 2 shows an example of an image of a mediumsized floc, which has an irregular shape and an elongated structure [13].
The task of training the network is to find such a recognition function h(image, category.subcategory)that approximates the unknown recognition function g(image, category.subcategory)on the entire domain of its definition that is, taking into account the values that are not included in the set.
The success of training was evaluated by the value of the deviation E: ( ) TensorFlow [14] and the simplified SmallVGGNet model of the Keras library [15] were chosen as the training framework.Three data sets of 250, 500 and 1000 images for each category were prepared for model training.
The analysis of the state of activated sludge was carried out according to the recommendations outlined in [6] and [13].For example, the presence of a large amount of Zoogloea ramigera in the studied samples leads to the formation of small-sized flocs that settle easily, but the water ISSN 2664-9969 remains cloudy.A high content of Sphaerotilus natans can cause toxic disturbances, and the sludge will not compact well.

Results and Discussion
The model was trained on prepared sets of images with duration of 100, 250, and 500 epochs.The training results showed that the recognition accuracy for 250 images and 100 epochs is quite high -98.30%, but the losses increase closer to the end of training (Fig. 3).As the number of images increases to 1000 and the training duration to 500 epochs, the recognition quality increases (Fig. 4), the loss decreases, and the training accuracy increases.The generalized training results are shown in Table 1.From the above results, it can be seen that the quality of neural network training is affected by the size of the dataset and the duration of training: the best training accuracy -99.98 % -was obtained for a dataset of 1000 images at 500 epochs.
The obtained results make it possible to determine the state of activated sludge with a sufficient degree of accuracy.Violation of the microbiological composition of sludge leads to such violations of the cleaning process as improper formation of flocs, the appearance of needle flakes and their dispersed growth, filamentous or sludge swelling, toxicity, etc.Further improvement of the methodology of learning neural networks and evaluating the quality of activated sludge is possible when conducting field experiments, which in the conditions of martial law in Ukraine is a significant limitation of this study.
Prospects for further research consist in determining the influence of the active microbiological composition on nitrification and denitrification processes using neural networks.

Conclusions
A methodology for the analysis of images of activated sludge using artificial intelligence methods for the prompt detection of problems in the processes of biological wastewater treatment is proposed.Electron microscopic images of activated sludge are classified into several categories, from which data sets of 250, 500 and 1000 images are formed.The criteria for evaluating the success of training were defined and the problem of neural network training was formalized.The TensorFlow framework and the simplified SmallVGGNet model of the Keras library were chosen for network training.The accuracy of image recognition depends on the size of the sample and the duration of the training and for the best model is 99.98 %.The trained model can be used as a reliable and fast tool for determining the state of activated sludge, evaluating and predicting the quality of wastewater treatment.

Fig. 3 .
Fig. 3. Results of model training on 250 images for 100 epochs

Fig. 4 .
Fig. 4. Results of model training on 1000 images for 500 epochs