Introduction

Global water utilities are estimated to be responsible for nearly 2% of all greenhouse gas emissions and are focused on reducing its carbon footprint (UNFCCC 2022). Drinking water treatment has been the primary focus for the water industry from the very beginning (Qu et al. 2007; Teodosiu et al. 2018), making sure our drinking water is free from pollutants is the focus of natural water and urban water systems and carries huge social responsibility (Mian et al. 2020). Coagulation–flocculation is the core of the treatment process unit in a drinking water plant, and it is an important contributor to the total energy consumption (Zhu et al. 2016, 2020, 2022; Lichtfouse et al. 2019).

Energy consumption during coagulation–flocculation is related to pollutant treatment, and being able to predict pollutant consumption essential for early planning of emission reduction technology. Since the effluents from drinking water plants are subject to national standards, there is a continuous demand for improved effluent quality (Hu et al. 2018; Crini and Lichtfouse 2019). The quality of output water is generally stable, and the quality of raw input water will determine the capacity for pollutant reduction, which can also be referred to as pollutant consumption capacity. However, the pollutant consumption capacity value of all pollutants is not balanced. Although some pollutants have been incorporated into the management system of drinking water quality standards, such as carbon and nitrogen compounds, they still produce many carcinogenic disinfection byproducts (Richardson et al. 2007; Srivastav et al. 2020; Kali et al. 2021).

Other pollutants that have not yet come under water management control include phosphorus, which can stimulate bacterial growth. Abu-Obaid et al. (2022) had promising success in removing phosphorous from wastewater in Canada through their polyacrylonitrile (PAN) electrospun nanofiber membrane (EN), fabricated with akageneite (Ak), and modified with benzyldimethyldodecylammonium chloride (BDDA). Morin-Crini et al. (2022) report many emerging industrial chemicals that have been identified as priority hazardous substances but cannot be eliminated from drinking water due to the inability of traditional wastewater plants to remove them. Their study reviewed these wastewater problems in China, Portugal, Mexico, Colombia, and Brazil. They noted the effluent quality indicators (such as turbidity) that are enforced in those countries, but their report highlighted the need for drinking water plants to guarantee pollutant consumption capacity that meets the requirements of water quality standards. The problem is that many of the uncontrolled pollutants are not covered by any mandatory limit in those countries; thus the pollutant consumption capacity value depends on the existing level of process treatment based on the capabilities of the wastewater plants. Zhang et al. (2016) evaluated 3,508 wastewater treatment plants in China. They found the average removal efficiency of ammoniacal nitrogen was 80%. They determined that most wastewater plants need to be upgraded to meet the Grade I-A discharge standard of pollutants for municipal wastewater treatment plants (GB 18918–2002).

With the rapid economic development and improvement in social productivity, a large number of products are consumed, and the control of pollutants is not robust, which inevitably leads to water pollution. The most significant issue is the risk to human the health from the persistence of pollutants in drinking water (Qu and Fan 2010; Bian et al. 2018; Inyinbor Adejumoke et al. 2018; Sathya et al. 2022). Second, the general increase in water consumption or decrease in water quality will increase the pollutant consumption capacity value. Furthermore, dosage and power consumption will inevitably increase, leading to increased economic demands for treatment (Gadipelly et al. 2014; Cai et al. 2020). Therefore, the opportunity for intelligent technology in drinking water or wastewater plants is increasingly urgent in order to promote the efficient operation and management of drinking water and maintain the security of water quality (Gupta et al. 2020; Mondejar et al. 2021).

The conventional treatment process of drinking water plants includes coagulation, sedimentation, filtration and disinfection (Ribau Teixeira et al. 2011; Lichtfouse et al. 2022; Lin et al. 2022). These treatment processes have been used since the beginning of the twentieth century. They are widely applied and have been an effective water treatment technology until increased terrestrial runoff from agriculture containing excess fertilizers with too much nitrogen and phosphorous have increasingly impacted on waterways worldwide. Additionally, a wide range of other substances such as pharmaceuticals, dyes, pesticides, potentially toxic elements from industrial wastewater, micro-plastics and other products have been found to increase the pollution burden on water systems (Vardhan et al. 2019). Studies of purification process in drinking water treatment plants have shown significant advances in coagulation. Wang et al. (2022) improved the coagulation–flocculation process by incorporating magnetic powder into a combined response surface methodology and an artificial neural network (RSM-ANN) to treat wastewater. They optimized and improved the removal of total phosphorus (total P) to the point that the surface water class IV standard was met using the magnetic coagulation process. Their research is being considered for application in municipal wastewater treatment plants.

The removal method used in water treatment plants determines the effluent effect of the subsequent process units. Therefore, it has a significant impact on other operating units and becomes a key link to solving primary problems for the entire water resource system. Therefore, evaluation of pollutant consumption capacity for the coagulation unit is critical. Coagulation is affected by many factors, including strong nonlinearity. Artificial neural networks (ANN) have provided go-to algorithms for nonlinear complex processes, even with limited knowledge of the process (Kim and Parnichkun 2017). The ANN have provided significant advantages in object recognition, classification and prediction (Singh et al. 2009; Li et al. 2021). It has a strong ability to capture nonlinear laws, short production times of prediction models, and convenient applications (Assémian et al. 2018; Hammoudi et al. 2019). Therefore, ANN has been applied in water quality monitoring and early warning systems of drinking water treatment plants for a long time (Hosseini-Moghari et al. 2015; Peleato et al. 2018; Azimi et al. 2019). The neural network model is particularly relevant in this application because structural parameters become the main mechanism of neural network model optimization, e.g., optimization learning rate, implicit, initial weight, and activation function. Even though other models rely on empirical knowledge and structural parameter exploration, the results generally have high uncertainty.

In this study, we explored a new idea to construct a predictive model for pollutant capacity consumption in water treatment units, taking coagulation–flocculation units as a case study to analyze pollutant capacity consumption and predict important parameters such as nitrogen, phosphorus and turbidity. We represent the coagulation–flocculation process as an “ecological reaction.” Firstly, coagulants do not act solely on one individual pollutant in the ecological environment. A food item is consumed by more than one organism and therefore pollutant consumption or food consumption is the result of a group action. Secondly, different types of pollutants will vary in their affinity for or response to coagulants which is similar to an organism’s affinity for food. Third, in the coagulation–flocculation process, there is a mutual behavior between pollutants, referred to as “bio-action,” and coagulants acting to remove pollutants. In nature, the competition among organisms for food is universal. Therefore, the presence of pollutants and coagulants is similar to the characteristic relationship between organisms and food. As such, bio-behavior (bio-action) is defined as the relationship between a bio-object (the pollutant) and food (the coagulant, which is bio-food). Biological behavior is the result of the combined effects of the bio-object, environmental conditions (bio-environment), and bio-food; thus, the output of the neural network is the product of the previous layer of neurons and weights. If the neural network is used to learn this biological behavior, the results of different biological behaviors competing with each other can reflect the results of the network output, which is consistent with the operation mechanism of the neural network. Therefore, the neural network has a potential to predict pollutants. A simple scheme of the water bio-logic model is shown in Fig. 1.

Fig. 1
figure 1

Flowchart for predicting pollutant capacity consumption in coagulation using a water bio-logic model. This flowchart briefly describes the correlation between the water quality indicators, the bio-action and artificial intelligence learning. In a real word, the behavior of organisms is the result of the interaction of biological objects, biological food and the living environment of the organisms. This biological behavior necessarily promotes their growth and death. We identify this behavior to also represent the consumption behavior of pollutants. The process of biological behavior is expressed through artificial intelligence learning. The strength of biological behavior is analyzed by the degree of correlation between the learning results and the actual results. CODmn is the potassium permanganate index in the graph, representing the amount of potassium permanganate that was consumed during sample measurement. The GT is the multiplied value of velocity gradient and residence time

With the model, the synthetic effects of the pollutant, coagulant and treatment environment in the coagulation process are revealed using the bio-action learning. All effects related to bio-action, including bio-food and bio-environment in the coagulation process, will be verified in the following analysis of the effective control of target pollutants through a sensitive analysis of the bio-action.

In this study, the pollutant consumption capacity analysis of the drinking water pollutants, ammonium and phosphorus, as well as chemical demand oxygen introduced water bio-logic relationships. This study establishes the bio-action process and maps them to artificial intelligence networks for predictive learning of phosphorus and ammonia control. The study presents (1) collected coagulation unit data from drinking water treatment plants, (2) defines “bio-action” as a product of the bio-environment, bio-food and bio-object, and (3) transforms this biological behavior into an artificial input neuron layer used to machine learn a back propagation network and bring new data into the system. The accuracy of the model to predict pollutant consumption capacity, the effect of biological behavior on coagulation, and the transfer behavior of biological process were evaluated to observe the model response in predicting pollutant consumption capacity.

Experimental

Data collection

We collected samples from the water source of the Xiangjiang River, Hunan Province, China carried out tank coagulation experiments, determined the water quality parameters of raw water and settling water respectively, and collected 70 sets of data. Bio-food was the coagulant dosage. The bio-environment included temperature, pH, total dissolved solids (TDS), and flow rate (Syafrudin et al. 2021). Bio-objects included turbidity, total nitrogen (Total N), total phosphorus (Total P), and the potassium permanganate index (CODmn), used to determine the pollution level of water. Data from two different water plants in the city of Xiangtan, Hunan Province, China were also collected. In water plant #1, 722 sets of data were included, and the bio-food received a coagulant dosage. The bio-environment included temperature, pH, TDS, and flow rate. The bio-object included turbidity and total P. Water plant #2 included 424 sets of data. Bio-food included dosage. The bio-environment included temperature, pH, total hardness, and chromaticity, and the bio-object included turbidity, ammonia nitrogen and CODmn.

Definition of bio-action

We defined bio-action as the interaction between bio-object and bio-food in the bio-environment, and its formula was expressed as follows:

$${\text{Bio - action}} = \sum\limits_{i}^{N} {\left( {{\text{Bio - object}}*{\text{Bio - environment}}*{\text{bio - food}}} \right)}$$

where i represents a specific contaminant; N represents the amount of contaminant; Bio-object represents pollutants. Bio-environment represents environmental factors, and Bio-food represents chemical dosage.

The bio-action expression of the data collected in this study is shown in Table S1. Bio-action is influenced by bio-food and bio-environment. Theoretically, bio-food determines the biological consumption of bio-action. If bio-objects have a strong affinity with bio-food, their biological activity (or bio-action activity) will be good, and the model prediction should also be good. If their affinity is weak, the bio-action will be poor and the model prediction will also be weak. In order to express the degree of this affinity, we used the principal component analysis (PCA) (Daffertshofer et al. 2004; Ouyang 2005; Mudge 2007) method to classify bio-food, bio-environment and bio-object, which can accurately analyze the correlations among factors (Bro and Smilde 2014; Liemohn et al. 2021) and define the degree of proximity to bio-food as the degree of affinity, so as to analyze their predicted effects. Their importance was determined by measuring the factor loading (Xue et al. 2011). The PCA was examined using IBM SPSS Statistics 21.0 (IBM Corp. 2012) scientific software.

Architecture of bio-action learning

Figure 2 shows a schematic diagram of the network training process. First, we used a typical back propagation neural network model to predict pollutant consumption capacity to verify the effectiveness of the water logic framework. The model is a widely used gradient descent algorithm consisting of input, hidden, and output layers (Deh Kiani et al. 2010). The number of input layers was the number of all bio-actions, while the number of hidden layers was equal to the number of bio-actions or bio-objects. The output layer was pollutant capacity consumption. This differs from traditional back propagation networks where we fixed the number of hidden layers to the number of Bio-objects.

Fig. 2
figure 2

A architecture flowchart for bio-action learning through neural networks in pollutant capacity consumption prediction. It presents the running procedure for the water bio-logic model, where bio-food, bio-object, and bio-environment interact to obtain bio-action as the input layer of the neural network. Because in different learnings, additional datasets will be involved, and “…” represents this in the figure

Simulation was performed on a scientific platform in MATLAB 2010b (Mathworks Inc. 2010). The dimension of bio-action data was pretreated and fixed within a range between − 1 and 1 as determined by the equation (see Text S1) in order to increase the model’s accuracy, convergence, and consistency. The training and test samples were randomly selected at 8:2. The initial weight and bias were optimized using a genetic algorithm by varying genetic algebra (20), population size (20), crossing rate (0.8), and probability of mutation (0.1), avoiding local over-fit of prediction.

Accuracy and sensitivity analysis

The accuracy of the model was determined by measuring the squared correlation coefficient of determination (R2) (Liemohn et al. 2021), root mean square error (RMSE) (Brisson et al. 2002; Liemohn et al. 2021), model efficiency (Huang et al. 2009), and consistency index (d) (Willmott 1981). The Olden algorithm (Olden et al. 2004) determined the importance of predicting each bio-action by calculating the weight of the neural network model. The details about these indicators and the algorithm are shown in Text S2.

Results and discussion

To reveal the clustering and distribution characteristics of bio-actions, principal component analysis (PCA) was performed. Subsequently, accuracy was assessed by measuring the square of the correlation coefficient (R2). Finally, the relationship between bio-action clustering, distribution characteristics and accuracy was further discussed.

Bio-action clustering and distribution characteristic

The results of PCA show a load plot for the first two principle components PC1 versus PC2 in various types of data, as shown in Fig. 3a–f. The factor clustering in Fig. 3a, c and e on the left reflects the bio-action interaction relationship in Fig. 3b, d and f on the right. In Fig. 3a, b, they show factor loading plots of laboratory data. The factors were divided into five categories (i.e., Classes 1 to 5 as shown in Fig. 3a), including Class 1 (turbidity, potassium permanganate index (CODmn) and dosage), Class 2 (temperature, total phosphorus, i.e., total P), Class 3 (pH and GT), Class 4 (total nitrogen, i.e., total N), and Class 5 (total dissolved solid (TDS)). The results of the pollutant bio-action were divided into four categories (see Fig. 3b). Accordingly, water plant #1 and #2 performed cluster analyses in the same way as in the laboratory. In addition, in laboratory data, bio-food was clustered with two bio-objects including turbidity and CODmn. In the water plant #1, bio-food was clustered with two bio-objects (turbidity and total P). In water plant #2, the three bio-objects (turbidity, ammonia nitrogen, and CODmn) were not clustered with bio-food.

Fig. 3
figure 3

Loading diagrams for the first principle components (denoted as PC1) versus the second component principle PC2 (denoted as PC2), respectively, related to water quality indicators and bio-actions: a, b in laboratory; c, d in water plant #1; e, f in water plant #2. It shows the variations of bio-actions for g and h in the laboratory, i water treatment plant #1 and j in water treatment plant #2. The results reflect the characteristic data trends for bio-actions in the laboratory and water plant # 1 and # 2. The degree of clustering between bio-object and bio-food affected the prediction results of pollutant capacity consumption. The trends characteristics of the four bio-actions (turbidity, total P, total N, and CODmn) appearing in the laboratory and in water plant # 1 were similar, while the trend of CODmn bio-action and ammonia nitrogen bio-action in water plant # 2 were similar, but different from the turbidity bio-action. Therefore, the characteristic trends in bio-action also influence the bio-action processes

Figure 3g–j shows the variation characteristics of bio-action data for different pollutants in the laboratory and in water plants. Figure 3g–h shows that the four-pollutant laboratory bio-actions (turbidity, total P, total N, and CODmn) had the same trend, indicating that the interaction among these four bio-actions might produce the same prediction effect. Figure 3i shows that the trend of turbidity bio-action and total P bio-action in water plant #1 are also very similar. Figure 3j shows a change in water plant #2 data, in which the CODmn bio-action and ammonia nitrogen bio-action trends were similar (see Fig. S1), but the similarity with the turbidity bio-action trend was small. Although the concentration of pollutants in water was different, this did not affect their trend characteristic analyses.

Accuracy

In this study, we analyzed the accuracy of the model to explore the feasibility of predicting pollutant consumption capacity through bio-actions data. The results of square of the correlation coefficient (R2) for the observed pollutant capacity consumption, and predicted value as well as its significance (P) values were shown in Fig. 4. The fitting results of the pollutant consumption capacity are shown in Fig. S2 and Table S2. The graphs for the laboratory study show excellent results for the predicted capacity consumption of four pollutants. For example, the turbidity consumption reached R2 (i.e., up to 0.97 (for training) and 0.97 (for testing), with corresponding P values of 0.98, and a root mean square error (RMSE) of 4.20 and 3.40. Efficiency factor was positive and the d value was close to 1. The fitting accuracy of other pollutant consumption (total P, total N, and CODmn) had the same accuracy. This may be affected by the trends in the bio-action characteristics. The trend in variability of the four bio-actions in the laboratory was the same; thus, each trend had the same biological behavior, which resulted in good prediction results for the four laboratory pollutant consumption capacity tests, including total N and total P as long as they were not clustered with bio-food. In addition, bio-actions significantly affected the accuracy. When the chemical oxygen demand (CODmn) was not included in the bio-action, the accuracy of prediction for total P and total N was poor. However, the accuracy of prediction for turbidity consumption was still good. Thus, CODmn was more closely related to the bio-actions of total P and total N, which agrees with subsequent analysis.

Fig. 4
figure 4

Results of square of the correlation coefficient (R2) of observed pollutant capacity consumption and predicted value (on the bottom bar graph) as well as its significance (P) (on the top bar graph) values in laboratory with sample size 70, with sample size 722 in water plant #1 and a sample size 424 in water plant #2. The two bar graphs presented the same types corresponding to P and R2 values. The results from model prediction of treatment trials in laboratory and water treatment plants show excellent agreement for the correlation coefficient (R2)

All tests produced good results in the laboratory, but the accuracy in a water treatment plant while good, could not match it, especially when testing CODmn capacity consumption value. The main reason is the difference in composition of the bio-action. For better accuracy, additional data collection in a water treatment plant is planned in future research.

From the predicted results of pollutant consumption capacity in water plant #1 and water plant #2, the predicted results of turbidity and total P consumption were better than the predictions concerning ammonia nitrogen and CODmn. The R2 of turbidity and total P remained above 0.89, with a maximum of 0.99. The R2 results for prediction of CODmn and ammonia nitrogen were only 0.63 (for testing) and 0.75 (for testing), respectively. Therefore, the bio-action of turbidity and total P were greater than that of ammonia nitrogen and CODmn in the current bio-environment. This may be related to the correlation between bio-object and bio-food in addition to the change characteristics. The turbidity and total P in water plant #1 are clustered with coagulant dosage, and the prediction results were good. In water plant #2, ammonia nitrogen and CODmn were not clustered with coagulant dosage, resulting in poor prediction results. Therefore, when the bio-object exhibits a stronger affinity for bio-food, it would enhance the prediction results of pollutant consumption capacity. For turbidity consumption capacity, its relationship seems to be almost entirely self-serving, without being affected by other factors. Overall, artificial intelligence learning through water bio-logic behavior is positive for predicting the results of turbidity, total P, CODmn, and ammonia nitrogen.

In the study above, we used bio-actions composed of different factors for contaminant prediction in the laboratory and in water treatment plants. In this study, we also looked at the effects of bio-action composed of the same factors. We selected seven factors in water plant #1 and in the laboratory measuring dosage, turbidity, total P, temperature, pH, TDS and GT. The same bio-action was calculated to predict turbidity and total P consumption capacity. Fig. S3a-b and Table S3 show that the fitting results of R2 for turbidity consumption was 0.96 (for both training and testing) in laboratory, and was 0.97 (for both training and testing) in water plant #1. For the total P consumption in water plant #1 (R2) was 0.85 for testing, but the R2 results in the laboratory were at a poor level (R2 = 0.68 for testing) (see Fig. S3c-d and Table S3). We studied the clustering characteristics of pollutants. In water plant #1, the total P was clustered with bio-food. Bio-objects have a strong affinity for bio-food, so the prediction results were good. However, this was the opposite of the results of the laboratory. The reason for the poor prediction of total P capacity consumption was that they had different clustering characteristics (see Fig. S3e-f). Based on the above analysis, it can also be inferred that the poor prediction results of ammonia nitrogen consumption and CODmn consumption were also affected by other reasons and one of which was not being classified with bio-food and having a weak affinity with bio-food. The water bio-logic model provides an important indication of the level of analytical prediction, which agrees with the biological behaviors. It demonstrated that the model is feasible.

Discussion

As noted above, the model was very effective for prediction of pollutant consumption capacity. We also investigated the bio-actions sensitivity to the accuracy of the model. Fig. S4a, e and g show the bio-action sensitivity results that affect turbidity consumption in water plant #1 and in the laboratory. The turbidity bio-action effect on turbidity capacity consumption accounted for more than 55.82% in each type of data, going up to 91.94% in water plant #1. Fig. S4b and f show the results of bio-action sensitivity affecting total P consumption. It can be seen that the total P bio-action was the main factor affecting the total P consumption, and the degree of influence was as high as 76.07% in water plant #1. The main reason for this was that according to the underlying data of water bio-logic and bio-action, the affinity of turbidity and total P consumption for food (i.e., dosage) was stronger than that of other pollutants.

As can be seen from the results of the sensitivity analysis (see Fig. S4 and Table S4), the main factors affecting turbidity and total P consumption capacity were attributed to their bio-action, while the total N (ammonia nitrogen) and CODmn capacity consumption were greatly affected by other pollutant bio-actions. Fig. S4c and i show the bio-action sensitivity results affecting the total N consumption and ammonia nitrogen consumption, respectively. They were less affected by their own bio-action and more affected by the other pollutant bio-actions. Fig. S4d and h also show the effect of each bio-action on CODmn consumption. The consumption of CODmn was almost unaffected by its own bio-action, and was greatly affected by turbidity bio-action. The main reason was that CODmn, ammonia, nitrogen and the total N had a lower affinity for coagulation than turbidity and the total P, thereby leading to a decrease in their coagulation efficiency. Therefore, water bio-logic activities can explain, predict, and reflect the degree of biological behavior of all biological objects (i.e., pollutants), thereby improving our understanding of process levels and giving a scientific basis for regulatory measures.

In addition to the above advantages, the use of water bio-logic models can reveal the combined effects of pollutants, coagulants and the environment in the coagulation process, which helps us analyze the logical relationship between water plant data and quickly establish predictive models. This research clarifies the principle of network input construction, which improves the efficiency of model building.

Conclusions

In this study, through bio-action learning of data from one laboratory and two water treatment plants, we observed that if bio-object and bio-food had a strong relationship in a specific environment, their pollutant consumption capacity predictions work well, which reflects the fundamental relationship of food competition in the biological world. In addition, when the bio-action exhibited the same change characteristics, the accuracy of prediction of pollutant consumption capacity  would also be the same. This enabled the introduction of the artificial intelligence bio-action learning effect by analyzing the close relationship between bio-objects, bio-environments and bio-foods, as well as bio-action variations, which provides an efficient model building method and provides a method to analyze the influence relationship between factors, which strengthened our analysis of the modeling problems associated with water treatment process data and biological behavior characteristics, which limited our model construction ideas and methods before use of artificial intelligence. This approach shows powerful potential to aid staff running water treatment plants who struggle with organizing data for modeling. The purpose of this study was expedite effective analyses of the problem of pollutant consumption capacity. It has great potential in energy demand assessment of water plant operations and to assist in model construction within related fields.