Journal: Water Conservation and Management (WCM)
Author: Mariam El-Marmar, Jamal Mabrouki, Mohammed Fekhaoui
Print ISSN : 2523-5664
Online ISSN : 2523-5672

This is an open access article distributed under the Creative Commons Attribution License CC BY 4.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited

Doi: 10.26480/wcm.02.2024.257.266


Coagulation and flocculation are one of the most important steps in leachate treatment. The main difficulty is to determine the optimal dose of coagulant to be injected according to the characteristics of the extract. Poor control of this process can lead to a significant increase in operating costs and failure to meet quality objectives at the outlet of the treatment plant. Aluminium sulphate is the most commonly used coagulant reagent. The determination of the coagulant dose is made using the test called the “Jar Test” conducted in the laboratory. This type of approach has the disadvantage of having a relatively long delay time and therefore does not allow automatic control of the coagulation process. The present work describes a Takagi Sugeno (TK) neuro-fuzzy model, developed for the prediction of the coagulant and flocculant dose used during the clarification phase in the Moroccan leachate treatment plant. The ANFIS model (fuzzy inference system based on adaptive neural networks), which combines fuzzy and neural techniques by forming a supervised learning network, was applied during the calibration phase and tested during the validation period. The results obtained by the ANFIS model were compared with those obtained with a multilayer perceptron neuron network (MLP) and a third model based on multiple linear regression (MLR). A coefficient of determination (R2) of the order of 0.92 during the validation period was obtained with the ANFIS model, whereas for the MLP, it is of the order of 0.65, and for the MLR model it does not exceed 0.4. The results obtained are of great importance for the management of the installation.


coagulation-flocculation modeling, leachate, neural networks, fuzzy neuro model


Morocco’s geographical location and the configuration of its relief explain the great complexity of its water problems. The temporal and spatial variability of precipitation is considerable and constitutes a characteristic of Morocco’s climate (Ouzerbane et al 2021; Boufala et al 2021). It is the cause of droughts that can last more than two years, and of floods due to violent storms or generalized weather disturbances. Faced with these extreme phenomena, the country has been able to adapt thanks to the adoption of a policy capable of meeting the needs of the various water users ( Abdelfadel et al 2020). In addition, to support socio-economic development, Morocco has implemented a national strategy for integrated water resources management for the 2030 horizon. It aims essentially at managing water supply and demand, preserving natural environments, reducing the negative impacts of extreme phenomena, regulatory reforms and strengthening means and skills (El Messbahi et al., 2020; Mliless et al., 2020).

Two main objectives are targeted in the management and operation of a water treatment plant: a quality objective and a cost objective ( Bell et al., 2021). To achieve the quality objective, it is necessary to produce a sufficient quantity of water continuously and with a quality that complies with the increasingly stringent drinking water standards in force (chemical, microbiological, etc.) This implies the design of a sophisticated treatment plant that is correctly dimensioned and includes a wide range of mechanical and hydromechanical equipment. When the water to be treated passes through such a system, the quality of the water obtained is modified at the physical, chemical or microbiological level (Batista et al 2020).

The nature and extent of these modifications depend on the characteristics of the water at the entrance to the plant and the degree of interaction between the various components of the process involved (Baxter et al 2020). Due to a large number of variables, as well as the complexity of the biological, physical and chemical phenomena involved in drinking water treatment processes, it is often very difficult to quantify in advance the interactions and relationships that exist between the inputs (variables) and outputs (quality parameters) of these processes Coagulation is a very important step in the production of drinking water from raw water. It aims at destabilizing colloids and their agglomeration as well as fine particles in suspension (Karnena et al., 2021). The consumption of coagulant agents makes this treatment step the most expensive operation in the treatment chain (Adetiba et al 2014; Heddam et al 2012).

The consumption of coagulant agents makes this processing step the most expensive operation in the processing chain.
Al_2 〖(SO_4)〗_3→Al_x 〖(OH)〗_y 〖(SO_4)〗_z→〖Al(OH)〗_3 (1)

Stage 1 is a hydrolysis phase, while during stage 2 the Al(OH)3 precipitate is formed. The addition of the coagulant to water has the following steps :(i) reduction of the hydrostatic charge by its adsorption to the surface of the particles; (ii) reduction of the diffuse charge. Therefore, the main factors influencing the efficiency of coagulation is the pH (Wei et al 2015), the initial turbidity (Yan et al., 2008), and the temperature of the water. Other variables characterizing the raw water influence the coagulation process considerably, namely, water conductivity, as well as dissolved oxygen (DO) (Wang et al., 2021). This measurement allows the professional to ensure that ultraviolet disinfection is possible (Semerjian et al., 2003; Ni and Wang, 2020). During the coagulation phase, the aim is to maximize the destabilization of particles and organic colloids to facilitate their agglomeration and subsequent removal by a solid-liquid separation process and to minimize the concentration of residual coagulant. The cost minimization of the operation is done by coagulation that is considered optimal. It corresponds to the coagulant dosage that ensures the achievement of all quality objectives (Ayat et al., 2021) ( Hassan El Ouazzani et al 2020).

To evaluate the optimal conditions for coagulation and floculation, so-called Jar-Tests (JT) are conducted on a laboratory scale. These, conducted under a wide range of operating conditions, determine the type of coagulant, its dosage, pH and agitation conditions that maximize turbidity reduction (Katano et al., 2021; Mabrouki et al., 2019). This type of approach has the disadvantage of having a relatively long response time. The coagulant dose is only modified once an event has occurred. Moreover, it does not allow following finely the evolution of the raw water quality ( Baxter et al., 1999; Mabrouki et al., 2019). This shows the interest of having automatic and efficient control of this process for better treatment efficiency and a reduction of operating costs. In recent years a new approach has been developed, which is the regulation of the coagulation process based on the descriptive variables of the raw water quality. This technique requires finding a model linking the optimal coagulant dose to these different variables (Valentin et al., 2000). Input/output regression modeling has already been used in many applications in this field. The proposed approaches are most often based on linear regression models (Bazer-Bachi et al., 1990).

Two mathematical models based on polynomial equations were proposed, relating the optimal dose of coagulant (aluminium sulfate) to the descriptive variables of raw water quality, namely: turbidity, resistivity, organic matter content, temperature and the nature of the mineral suspension. Other linear models have been proposed (Ratnaweera et al., 1995). The model is based on calcium ion concentration, bicarbonate, sulfate, initial turbidity, temperature and pH. The data used in the model developed in this study are river flow, sedimentation time, temperature, turbidity, pH and conductivity, while the model proposed includes color, river flow, pH, conductivity and temperature (Zheng et al., 2011). These studies have shown interest in this approach but also the limitations of linear modeling for this type of problem. The important progress made in the last few years in the field of artificial intelligence has made it possible to reduce the difficulties and to overcome the limitations of linear models. Models based on the technique of artificial neural networks have been developed (Li, et al., 2004). This modeling has been integrated with the construction of a software sensor for the online determination of the optimal coagulant dose according to various raw water quality characteristics such as turbidity, pH, conductivity, etc. The model is based on two types of neural networks, a multilayer perceptron (MLP) (Madhiarasan et al., 2017). On the one hand, and a network-based mainly on the use of Kohon’s self-organizing maps for data preprocessing, on the other hand (Turner et al., 1995; Adger et al., 2000). Other models have been proposed which all express the dose of coagulant to be injected as a function of the different descriptive variables characterizing the raw water at the inlet of the water treatment plant. Some studies have shown the importance of neural networks as a tool for the elaboration of mathematical models for automation study supervision of the processes involved in the water treatment plants (Fang et al., 2021; Lek et al., 1999; Nikzad et al., 2012). In this paper, an alternative method for predicting the coagulant dose as a function of six descriptive variables characterizing the raw water at the leachate treatment plant inlet is proposed.

This method is based on the Adaptive Neuro-Fuzzy Inference System (ANFIS) model, which combines floue logic and neural networks to form a hybrid network, using error backpropagation as a learning algorithm. The results obtained are compared with those of an artificial neural network-based model, the multilayer perceptron (MLP) and a multiple linear regression (MLR) based model. In order to reduce the amount and cost of chemicals required for treatment, several authors have studied the possibility of recirculating part of the chemical sludge produced (preformed flocs). This recirculation would allow exploiting both the residual coagulant power of the sludge and its adsorption capacity while providing a high coagulation concentration.


2.1 Multiple linear regression

Regression analysis is a statistical technique that makes it possible to estimate the relationship between variables that have a reason and outcome relationship (Kaya Uyanık et al., 2013). Contrary to the concept of simple linear regression, which models a response variable Y, starting from a single predictor variable X (Li et al., 2018). from a dataset that includes observations for these two variables for a particular population (Tranmer et al., 2008). Multiple regression is performed to describe how a single response variable Y depends linearly on several predictor variables (x1, x2, …., Xp). As an example: The selling price of a store may depend on the appropriateness of its location, its area, the year of construction of the house and many other factors. In addition, for the study of multidimensional data, (Wong et al., 2020) the multiple linear regression model has proven to be the most widely implemented statistical tool for understanding the relationship between several independent variables and a dependent variable (Davim et al., 2008) The general expression for this model can be written as follows:

y = β0 + β1×1 + β2×2 + ··· βkxk + ε. (1)
Where: where Y is the dependent variable, x and n are independent variables, α the coefficients and ε the random error (S.-I. Lee et al., 2019 ).

2.2 Artificial neural networks

The study of neural networks began in the early 1940s with the work of McCulloch and Pitts and in 1962, it was extended to the problems of classification and pattern recognition by Rosemblatt (Rosemblatt, et al 1958; Muazu Musa et al., 2020). Indeed, neural networks are tools that are found very often with the purpose of classification, estimation, prediction and segmentation. They have their origins in biological models and their composition is based on elementary units called neurons. Moreover, these networks are organized according to architecture and they are well adapted for problems with continuous and possibly noisy variables. They obtain good performances, in particular, for pattern recognition (G. D et al., 2007). Regarding a neural network, in the artificial sense, or an artificial neural network (ANN), as their name indicates, are computational networks that try to achieve a simulation in a coarse way the networks of nerve cells (neurons) of the central nervous system (human or animal) through the processing of information that is based on simplified mathematical models of neurons whose learning process results from the experience (Oliveira et al., 2020). They are made up of a set of simple, analogous entities, capable of interacting with other neurons through the structure of the network that they form (Figure 1). Neurons are linked together by connections, that is, direct and oriented links from one neuron to another. A neuron determines its value (its state) according to its environment via the connections of the network which allow it to know the state of the neurons to which it is linked. A neuron k calculates its state and produces an output signal yk, from the input signals x1, x2, … . xp, constituted by the state of the connected neurons, weighted by the synaptic weights of the connections w1, w2, ….. wp. The production of a new state is realized by the function f, called activation, transition or transfer function. As illustrated in Figure 1. The production of a new state is realized by the function f, called the activation, transfer or transition function.

Figure 1: An artificial neuron

The activation function f is a local procedure that each neuron applies by updating its activation level according to the activation of its neighbours. The most commonly encountered function is a sigmoid function such that if the weighted sum is greater than a threshold, then the neuron is activated; otherwise nothing.

S(y)=1/(1+e^(-y) ) (2)

The output of the neuron is a non-linear function of its input (Aj):
Y_j=f (A_j) (3)

Artificial neural networks are useful tools for solving many types of problems, such as classification, clustering, optimization, approximation and prediction (Desai et al., 2020). The states of the neurons of the first layer will be fixed by the problem being treated through a vector x = (x1; x2; …xn). With the states of the first layer being fixed (Figure 2), the network will be able to calculate the states of the neurons of the other layers. In this sense, each neuron of the hidden layer receives a parameter-weighted sum (Wij), which are then often referred to as “weights” or, because of the biological inspiration of neural networks, “synaptic weights”, of all the inputs, to which is added a constant term W0 or “bias”:

j=W_0+∑_(i=j)^n▒〖W_ij×X_i 〗 (4)

Figure 2: Architecture of the multilayer perceptron (MLP) neural network.

Each neuron in the output layer receives a parameter-weighted sum (wjk), to which is added a constant term B0 or “bias” :
O_K=B_0+∑_(j=1)^m▒〖W_jk×Y_j 〗 (5)

The output of the network O (for Output) is a linear function of the weights of the last layer of connections (which connect the m hidden neurons to the output neurons), and it is a nonlinear function of the parameters of the first layer of connections (which connect the n inputs of the network to the m hidden neurons). This property has very important consequences (Shi et al., 2021)
It has been shown that a neural network with a finite number of hidden neurons, all with the same activation function, and a linear output neuron is a universal approximation (Taud et al, 2018). The values of the weights and the bias are modified and updated via a supervised learning algorithm. The latter consists in obtaining a set of examples, i.e. a finite set of known input-output pairs (examples that constitute the training set).

The objective of this calculation is the minimization of an error function between the desired response and the response obtained at the output of the model. The most commonly used algorithm is the backpropagation of the error. It estimates the gradient of the error function for the parameters (weights and bias) of the model and performs the adaptation of these parameters successively from the output layer to the input layer (Figure 1). This consists in performing a gradient descent on the error criterion ‘E’ by minimizing a cost function, generally the mean square error (Djokhrab et al., 2015).

Gradient methods can be divided into two categories: first-order methods, which use only the gradient of the function (case of the error backpropagation algorithm) and second-order methods, which generalize the gradient descent to the second degree of the error function. These are iterative methods that consist in replacing the cost function with its quadratic approximation. We can mention for example the Newton, quasi-Newton and Levenberg-Maquardt methods. The latter is used in our study.

2.3 -Neuroflou – neuro-fuzzy model

Neuro-fuzzy systems are systems that combine the advantages of two complementary techniques and provide a good knowledge representation. They are trained by a learning algorithm inspired by the theory of neural networks (Nauck et al., 1997). The integration of neural networks within these systems improves their performance thanks to the learning capacity of these networks. Conversely, the injection of fuzzy rules in neural networks, often criticized for their lack of readability, clarifies the meaning of the network parameters and facilitates their initialization, which represents a considerable gain in computation time for their identification. The table below lists the industrial and scientific advantages of neural networks (Table 1).

2.3.1 Logical floue

Fuzzy logic is a very efficient method coming from fuzzy set theory, for the reason of filling the gap between the imprecision of the real world and the precision of classical logic. It is seen better adapted to the real world than binary logic, because of its mastery of the concept of uncertainty and imprecision which are logical consequences of the complexity of systems. Indeed, it is very useful in conditions where there is large uncertainty and unknown variations in the parameters and structure of the system ( Madour, F. et al; 2007).

2.3.2 Characteristics of the subsets flous

A linguistic variable (Menni et al., 2017), is a variable whose values are words or sentences expressed in a natural or artificial language ( DUBOIS, et al; 2021). A linguistic variable is defined as: “x_name, L(x),U, Mx” with: (i) x_name : the name of the linguistic variable (e.g. : dose of coagulant), (ii) L(x) = {L1; L2;….; Ln} is the set of linguistic values (or called symbol or linguistic term or label) that the variable x_name can take. For example L(x) = {low, medium, high} to characterize the dose of coagulant; (iii) U corresponds to the universe of discourse associated with the variable x_name (example: the dose of coagulant varies between 5 and 35 mg.L-1). This is the set of all numerical values that the numerical variable associated with the linguistic variable x_name can take; (iv) Mx is a function that associates any symbol in L(x) with a meaning floue.

Modeling an input/output system by floue logic involves three essential steps:
• The fuzzification of input variables, which consists of transforming the available numerical inputs into floue parts. It is then possible to associate with variables coefficients belonging to flous subsets taking values in the interval (0, 1).
• The inference floue, composed by the rule base and by the database. The combination of the inputs with the floues rules allows for inference.
The defuzzification is the reverse operation of the fuzzification. It converts the floues parts related to the outputs of the inference mechanism into numerical outputs. There are several defuzzification techniques (Das et al., 2019; Takagi et al., 1985).
• However, the most commonly used technique is the centre of gravity technique.

2.3.3 Model flou used: The Sugeno model

Takagi and Sugeno have proposed a type of fuzzy model, suitable for approximating a general class of nonlinear systems. It consists of rules whose conclusion part is put in the form of a linear state representation (Tanaka et al., 1992).
. Like Mamdani’s, the Takagi – Sugeno model is built from a base of “If…Then…” rules, in which while the premise is always expressed linguistically, the consequent uses numerical variables rather than linguistic variables. The consequent can be expressed, for example, as a constant, a polynomial, or more generally as a function or a differential equation depending on the variables associated with the antecedent. In a general way, a Takagi-Sugeno (TS) type model is based on a collection of Ri rules of the type (Moreno Cardenas et al., 2020):
Ri : if x and Ai So yi = fi (x), i = 1, 2,…. R (6)

Where :
Ri: the i-th rule of the model
r: the number of rules that the rule base contains.
x∈ R: the input variable (antecedent)
y∈ R: the output variable (consequent).
Ai: the fuzzy subset of the antecedent of the i-th rule, defined, in this case, by a (multivariable) membership function of the form :
µAi(x) : Rp——->[0, 1] (7)

2.4. ANFIS model

ANFIS (Adaptive Neuro-fuzzy Inference System) is one of the earliest neuro-fuzzy systems in existence (Sagir et al., 2020).
, it is a typical approach in neuro-fuzzy development and robustness, which has shown significant, results in modeling non-linear functions. It is a class of adaptive networks introduced by J.S.R. Jang (Jang et al., 1995).and can be seen as a non-looped neural network for which each layer is a component of a neuro-fuzzy system. The ANFIS network is composed of five layers; excluding the input layer (Malekizadeh et al., 2020). ANFIS is used for the design of two systems, namely thermal comfort and group technologies in production and operations management (Naadimuthu et al., 2007).

It consists in using a 5-layer MLP neural network for which each layer corresponds to the realization of a step of a Takagi Sugeno type fuzzy inference system .Among the advantages of the model ANFIS (Figure 3):
• Exploitation of the available knowledge
• Reduction of the size of the rule base
• Reduction of the learning complexity
• Immediate efficiency from the beginning of the learning process and the possibility to avoid erratic initial behaviors.

Figure 3: The architecture of ANFIS (Djokhrab, 2015).

The adaptive neural fuzzy network (ANFIS: Adaptive Neural Fuzzy Inference System) is composed of a set of neurons connected by direct connections. Each neuron models a parameterized function; changing the values of its parameters causes the function to change, as well as the overall behavior of the adaptive network. The set of parameters of an adaptive network is distributed over the set of neurons constituting it. This means that each neuron has a local set of parameters: if this set is empty then the associated neuron is represented by a circle and its function is fixed; fixed neuron, otherwise it is represented by a square and the associated function depends on the values of these parameters; adaptive neuron. In an ANFIS, the connections between neurons are only used to specify the direction of propagation of stimuli from other neurons. The structure of ANFIS is composed of five layers, two types of membership function (bell or Gaussian) and if-premise rules then consequently ANFIS is one of the very first neuro-fuzzy systems that exist. It is widely cited in the literature as it has proven its efficiency over time with its simplified learning algorithm: the gradient descent method and the least-squares method (Verma, S. K., et al; 2018).

Layer 1: Each node in this layer is an adaptive square node with a:
O_(1,i)=μ_Mi (X_1) pour i=1,2,…,m (8)
O_(1,i)=μ_(L_i2 ) (_(X_2 )) pour i=1,2,….,m (9)

Where x1 (or x2) is the input of node i, Mi (or Li) is the linguistic term associated with its function.
The nodes in this layer represent the degree to which x1 (or x2) belongs to Mi (or Li); this is the fuzzification phase.
Layer 2: Each node in this layer is a fixed circular node, called (Π), which receives the outputs of the fuzzification nodes and computes their activation. The number of nodes in this layer is equal to the number of “Si…..Also “rules in the flou inference system.

O_(2,i)=W_i=μ_Mi (X_1 )×μ_Li (X_2 ) ,i=1,2 (10)

Layer 3: Each node in this layer is a fixed circular node, called (N). This is the normalization layer in which each node computes the normalized degree of membership in a given floue rule. The result obtained represents the participation of each floue rule in the final result. This layer returns normalized defuzzification outputs.

O_(3,i)=¯(w_i )=W_i/(W_1+W_2 ) (11)

Layer 4: Each node i in this layer is an adaptive square node that corresponds to the initial input weighted by the normalized membership degree of the rule floue.

O_(4,i)=¯W_i f_i=¯(W_i ) (pi.x_1+qi.x_2+ri) (12)

Where wi is the normalized output of layer 3, and {pi, qi, ri} is the set of output parameters of rule i. This is the defuzzification phase.

Layer 5: consisting of a single circular fixe node called (Σ) which receives the sum of the outputs of all defuzzification nodes, and provides the output of the ANFIS model.

O_(5,i)=∑_i▒¯W_i f_i=(∑_i▒〖W_i f_i 〗)/(∑_i▒W_i ) (13)

2.4.1 Learning the ANFIS model

Over time, ANFIS has become widely cited in the literature due to its proven effectiveness with its simplified learning algorithm: the gradient descent method and the least-squares method (Sagir and Abubakar, 2020).

In ANFIS learning, membership function parameters are extracted from a data set that describes the behavior of the system. The ANFIS learns features from the dataset and adjusts the system parameters according to a given error criterion. Successful implementations of ANFIS in biomedical engineering have been reported for classification (Sihag, P., et al; 2019), data analysis (Shekofteh et al., 2017).

2.5 Model validation

Validation allows us to judge the ability of the model to reproduce the modelled variables. Several criteria were chosen. In our case, we used the coefficient of determination (R2), the root means square error (RMSE) and the biased mean (B).

2.5.1 Coefficient of determination (R2)

R^2=[(1/N ∑_(i=1)^N▒(Y_iobs-¯Y_obs )(Y_ical-¯Y_cal ) )/(σ_obs×σ_cal )]^2 (14)
yiobs and yical are the observed and model-calculated values of the coagulant dose for day i, respectively, Yobs and Ycal are the means of the observed and model-calculated values, σobs and σcal are the standard deviations of the observed and calculated values.

2.5.2 Root Mean Square Error (RMSE)

Nowadays, it is one of the most widely used measures of goodness of fit in structural equation modeling (SEM) (Jackson et al., 2009).recently reviewed 194 SEM studies published between 1998 and 2006 and reported that RMSEA was the second most popular goodness-of-fit index reported in 64.9% of the studies reviewed. The high popularity of the RMSEA is based on its properties:
First, simulation studies have shown that it is largely invariant to sample size.
Second, it rewards parsimonious models.
Third, the RMSEA has a minimum of zero with suggested conventions for cutoff criteria for excellent, good, and poor fit.
Fourth, a confidence interval around the RMSEA point estimate can be calculated to assess the degree of uncertainty, allowing for hypothesis testing.
Fifth, power analysis can be performed fairly easily to determine the trial number needed for adequate power in these tests (Wang et al., 2021).


The database used was randomly split into two parts, one for the calibration of the models (MLP, RLM and ANFIS) and the identification of the parameters which represent 80% of the total size of the database and the other for the validation (20%). The performance criteria are computed in both calibration and validation modes. In the case of our study, the variables are of a different physical nature, characterized by different units, which leads us to normalize them in order to bring the range of evolution of the values taken by the variables within a standardized interval, fixed a priori. It is desirable because it avoids the system to be parameterized on a particular range of values, thus ignoring the extreme values. For our case, we have normalized the data using the following formula:

Xn_(i,k)=(X_(i,k)-m_k)/σ_k (15)

xn, i, k: the standardized value of variable k for individual i
mk: the mean of the variable k
σk: the standard deviation of variable k.

Principal component analysis (PCA) was applied to detect the contribution of each input variable (descriptive variable characterizing the raw water) in explaining the phenomenon studied in order to optimize the relevant number of inputs for the models applied and to highlight possible influences of a descriptive variable on the phenomenon.

Principal component analysis (PCA) is a descriptive technique that allows us to study the relationships that exist between variables, without taking into account, a priori, any structure (Ringnér et al., 2008). The objective of PCA is to provide linear summaries of the original variables, i.e. to replace the original variables with linear combinations of them. These new variables are called principal components. The interesting results from the application of a PCA are the correlation coefficients of the original variables, associated with each principal component, the matrix of eigenvectors and the associated eigenvalues.

Note that each principal component is representative of a portion of the variance of the measures of the process studied. The eigenvalues are the measures of this variance and can therefore be used to select the number of principal components to be retained. Many research studies have proposed the use of principal component analysis as a tool for modeling complex processes from which a model can be obtained. The principal component analysis is an extremely powerful technique for synthesizing information, used to reduce the dimensionality of a data set especially when there is a large amount of quantitative data to process and interpret (Zaki et al., 1993). Thus, a set of correlated variables is transformed into a new set of orthogonal variables called principal components, so that as much of the total variation in the observed data as possible is reported by a small number of principal components. Each principal component is a linear combination of all the original variables (Kacha et al., 2019).

The first essential step in PCA is to choose the variables from which to perform the PCA. Depending on what is being analyzed (Table 2), one will choose one variable or another. Once the variables have been selected, the calculation of the correlation matrix makes it possible to analyze the bilateral relations existing between the different variables selected (Libório et al., 2020).

The principal component extraction process continues until there are as many principal components as there are variables. The statistics of interest from a PCA are the variable weights vectors, associated with each principal component (Table 2), and their variance, λi (Table 2). The picture of the original variable weights is used to interpret each principal component while the associated variance indicates what percentage of the total variance of the set of original variables each principal component represents. Based on the results, we note that it is essential to consider the first five principal components, in order to have 90% of the total variance.


4.1 Description of the results obtained with the PCA

The first eigenvalue (λ1 = 2.627) represents the variance explained by the first principal component (CP1). It corresponds to 37.52% of the total variance (Table 2) and is therefore found to be the predominant axis. It is explained by the variables pH, TU and T.
There is a strong correlation between these variables and the first principal component. We will take this observation into account later to avoid the redundancy of information. The principal component CP2 has the second largest eigenvalue (λ2 = 1.427). It represents 20.38% of the total variance and is built around the OD variable with a correlation coefficient of 0.53 in absolute value. The two components CP1 and CP2 explain 57.90% of the total variance. The third principal component accounts for 15.58% of the total variance with an eigenvalue of (λ3 = 1.091) and is built around the variable CE with a correlation coefficient of 0.65 in absolute value. The three components CP1, CP2, and CP3 explain73.48% of the total variance. Since principal component analysis did not significantly reduce the number of original variables, by a smaller number, an attempt to compare between different combinations of the input variables was conducted. Several models were tested.

We developed five model variants (Table 3), namely variant v2 with two input variables (15 models), v3 with three input variables (18 models), v4 with four input variables (13 models), v5 with five input variables (6 models) and variant v6 with six input variables (1 model). In total, 53 models representing five variants were tested and the best model from each variant was selected (Table 3), namely model M2 using T and CE; model M3 with T, CE and pH; model M4 with T, CE, pH and TU; model M5 with T, CE, pH, TU and OD and model M6with T, CE, pH, TU, and OD. For the five models mentioned, the coagulant dose represents the output of the model. For the flocculation dose, the concentration varies between 2 and 3 g/l.

4.2 Description of the results obtained with the ANFIS model

To highlight the advantages of the proposed neuro floue modeling approach, a comparative study was performed comparing the performance obtained with the neuro flou ANFIS model and that obtained using an artificial neural network-based model, multilayer perceptron (MLP) and multiple linear regression (MLR) based model, respectively. In the case of the ANFIS-type neuro flous models used in the present work, the total number of rules floues (Table 4) to be optimized will be determined by the following rule:


Where: NRF represents the number of floues rules established; NSF represents the number of linguistic values (label) for each input variable, and NVE represents the number of input variables. We chose three linguistic values for each input variable, each represented by a Gaussian-like membership function, and given by the following formula:

f(X,σ,c)=e^(〖-(x-c)〗^2/〖2σ〗^2 ) (17)

A Gaussian membership function can be defined by two parameters: σ and c. The latter two constitute the parameters of the premise parts to be optimized during the learning phase. We immediately notice that the number of parameters of the premise parts to be optimized (Table 4) will be determined by the following rule:

NPP =NSF×NVE×2 (18)
With: NPP represents the number of parameters of the premise parts.

The parameters of the conclusion parts (consequent) to be optimized on their part are determined by the following rule:


Where: NPC represents the number of parameters of the conclusion parts; NVS represents the number of output variables (the coagulant dose and flocculation). Moreover, it should be noted that as the number of partitions in linguistic values increases, the number of parameters to be optimized increases. Thus, the total number of parameters to be optimized (NTP) is equal to the sum of the parameters of the conclusion parts (NPC) and the premise parts (NPP).


4.5 Comparisons and discussions of the results obtained by the different models

As mentioned in paragraph 1, the coagulation and flocculation process involves very complex and non-linear reactions. The objective of our work is to design a model to determine the dose of coagulant and flocculation taking into account a large number of parameters. In this perspective, neural networks and neuro flous systems seem to be an interesting research path (Figure 4).

Figure 4: Comparison of observed and calculated values for the RLM model, (a) calibration, (b) validation

We tried to find an appropriate relationship between all (or some) of the model input variables. During all computational phases, we were interested in comparing the graphs from the validation and calibration of the different models tested, as well as in comparing the computed numerical criteria. For the ANFIS model, we used three linguistic values (label) for each input variable, while for the MLP model we varied the number of neurons in the single hidden layer from 1 to 20 as outlined in Section 5.3. After each test, we compare the output obtained and the desired output, we correct the weights to minimize the error committed. We proceeded to a comparison between the results obtained by the five selected models (Tables 7 and 8) in calibration mode as well as invalidation mode, namely models M2, M3, M4, M5 as well as the model M6 with six inputs that include the six descriptive variables characterizing raw leachate. It can be seen from Tables 7 and 8 that the results obtained by multiple linear regression (MLR) are very poor, both in calibration and validation mode; whatever the number of input variables used, the coefficient of determination does not exceed 0.36, while the RMSE is close to 8.15 invalidation mode for the six input model M6, which represents the best model based on multiple linear regression (MLR) (Figure 4). On the other hand, we notice that for both models M2 and M3, the multiple linear regression (MLR) models presents better results than the MLP model in validation mode, with a determination coefficient of about 0.25 and an RMSE of 8.26 for the M3 model, while for the MLP model, we record a determination coefficient of about 0.17 and an RMSE of 9.76 for the same M3 model. This reflects the complexity of the studied phenomenon, on the one hand, and, on the other hand, these two models do not reflect the physical reality of the studied coagulation process. We will see later that these two models will be excluded and that it is essential to include more variables in the input of the models to properly demonstrate the forte non-linearity of the coagulant dose relationship as a function of the descriptive variables of the raw water.

For the MLP and ANFIS models (Tables 7 and 8), the results obtained are significantly better compared to those obtained by multiple linear regression (MLR), for models M4, M5 and M6. We note that the coefficient of determination R2 does not exceed 0.35, either in calibration mode or invalidation mode, for the models based on multiple linear regression. From the M4 model (Figure 5), which uses four descriptive variables, we notice a clear performance improvement. However, the ANFIS model performs better than the MLP model. R2 reaches 0.72 in both calibration and validation modes, while for the MLP model it is around 0.64 in calibration mode and 0.60 in validation mode.

Figure 5: Comparison of observed and calculated values for the ANFIS model, (a) calibration, (b) validation
Figure 6: Comparison of observed and calculated values for the MLP model, (a) calibration, (b) validation

The best results of our research are obtained by the M6 model which includes all six descriptive variables. The ANFIS model (Figure 4) performs better than the MLP model (Figure 6). This is mainly due to the ability of flous models to simulate strong complex and nonlinear phenomena. We note that the coefficient of determination R2 reaches 0.95 for an RMSE of 1.89 in calibration mode while it is around 0.92 for an RMSE of 2.11 invalidation mode (Tables 7 and 8), while the MLP gives a coefficient of determination equal to 0.8 in calibration mode and 0.75 in validation mode. The neural network, in this case, consists of 13 hidden neurons with several parameters equal to 105 (Table 5). In light of the results obtained, we can conclude that the ANFIS model that includes the six descriptive variables (M6), namely (temperature, PH, conductivity, dissolved oxygen, and turbidity), is the final model selected in this work.

The importance of the neuro flou ANFIS model lies in its ability to simulate complex and non-linear processes by taking into account a large number of parameters. It is important to recall that the selected model consists of more than 5,139 parameters with more than 729 floues rules (Table 6).


This paper has materialized as a contribution to neuro floue modeling that we introduce in the management of the leachate treatment plant. The knowledge of the water quality variation at this plant is important to understand and better interpret the behavior of the different process components involved. To establish a mathematical model for the prediction of the coagulant dose (with fixing the flocculant dose), we proposed a comparison between two models based on the neural concept, one using a neural structure of its own which is the multilayer perceptron (MLP), and the second one a neural flou model that combines a flou inference system in a neural network (ANFIS), and a third model based on multiple linear regression (RLM). The results obtained by multiple linear regressions are far from acceptable, and a linear approach to this type of problem is ruled out. The results obtained by the ANFIS model are better than those found by the neural network. The numerical performances are more appreciable for the model using six descriptive variables. This confirms the complexity of the process and the strong non-linearity of the relationship between the coagulant dose and the different descriptive variables.


Mariam EL-MARMAR performed conceptualization, data collection, sample analysis, data analysis and wrote the first original draft of the manuscript. Jamal MABROUKI supervised the data collection, laboratory analysis and provision of materials and reagents. Mohammed FEKHAOUI supervised and validated the research activity and review the final paper. All the authors commented on previous versions of the manuscript, read, and approved the final manuscript.


The corresponding author would like to thank the Center for Water, Natural Resources, Environment and Sustainable Development, for their support in participating in carrying out research at the Center.


The present research did not receive any financial support.


The authors declare that there is not any conflict of interests regarding the publication of this manuscript.


No life science threat was practiced in this research.


No data availability


Abdelfadel, F., Hilali, M., Fontaine, C., El Albani, A., Mahboub, A., Eloy, L., Razack, M., 2020. Hydrogeology of a Complex Aquifer System in Semi-Arid Mountainous Region: The Eastern Upper Guir Basin in the High Atlas (Morocco). Water, 12(10), Pp. 2849.

Adetiba, E., Ibikunle, F. A., Daramola, S. A., Olajide, A. T., 2014. Implementation of efficient multilayer perceptron ANN neurons on field programmable gate array chip. International Journal of Engineering & Technology, 14(1), Pp. 151-159

Adger, W. N., 2000. Institutional adaptation to environmental risk under the transition in Vietnam. Annals of the Association of American Geographers, 90(4), Pp. 738-758

Ayat, A., Arris, S., Abbaz, A., Bencheikh-Lehocine, M., and Meniai, A. H., 2021. Application of response surface methodology for modeling and optimization of a bio coagulation process (sewage wastewater treatment plant). Environmental Management, 67(3), Pp. 489-497.

Batista, D., Costa, M. R., 2020. Landscape and Water Heritage in Mountainous Areas: From the Atlantic to the Mediterranean, from Northern Portugal to Southern Morocco. The History of Water Management in the Iberian Peninsula: Between the 16th and 19th Centuries, 201.

Baxter, E. M., Schmitt, O., Pedersen, L. J., 2020. Managing the litter from hyperprolific sows. In The suckling and weaned piglet Wageningen Academic Publishers, Pp. 71-106.

Baxter, J. S., and McPhail, J. D., 1999. The influence of redd site selection, groundwater upwelling, and over-winter incubation temperature on survival of bull trout (Salvelinus confluentus) from egg to alevin. Canadian Journal of Zoology, 77(8), 1233-1239.

Bazer-Bachi, A., Puech-coste, R., and Probst, J. L., 1990. Mathematical modeling of optimal coagulant dose in water treatment plant. Rev. Sci Edu, 3 (4), Pp. 377-397.

Bell, B., 2021. White dominance in nursing education: A target for anti‐racist efforts. Nursing Inquiry, 28(1), e12379.

Boufala, M. H., El Hmaidi, A., Essahlaoui, A., Chadli, K., El Ouali, A., Lahjouj, A., 2021. Assessment of the best management practices under a semi-arid basin using SWAT model (case of M’dez watershed, Morocco). Modeling Earth Systems and Environment, Pp. 1-19.

Das, S. S., Islam, M. M., and Arafat, N. A., 2019. Evolutionary algorithm using adaptive fuzzy dominance and reference point for many-objective optimization. Swarm and evolutionary computation, 44, Pp. 1092-1107.

Davim, J. P., Oliveira, C., and Cardoso, 2008. Predicting the geometric form of clad in laser cladding by powder using multiple regression analysis (MRA).

Desai, M., Shah, M., 2020. An anatomization on breast cancer detection and diagnosis employing multi-layer perceptron neural network (MLP) and Convolutional neural network (CNN). Clinical eHealth.

Didier, D, Luc, J., et Henri. P., 2021 Thick sets, multiple-valued mappings, and possibility theory. In : Statistical and Fuzzy Approaches to Data Processing, with Applications to Econometrics and Other Areas. Springer, Cham, Pp. 101-109.

Djokhrab, A. E., 2015. Planification et Optimisation de Trajectoire d’un Robot Manipulateur à 6 D. D. L. par des Techniques Neuro-Floues, Université Mohamed Khider – Biskra..

El Messbahi, H., Dautria, J. M., Jourde, H., Munch, P., Alard, O., Bodinier, J. L., Ouali, H., 2020. Eruption dynamics of pleistocene maars and tuff rings from the Azrou-Timahdite district (Middle Atlas, northern Morocco) and its relevance to environmental changes and ground water table characteristics. Journal of African Earth Sciences, Pp. 167, 103845.

Fang, C., Dong, H., and Zhang, T., 2021. Mathematical models of overparameterized neural networks. Proceedings of the IEEE, 109(5), Pp. 683-703.

G. D., 2007. Principles of Artificial Neural Networks, World Sci., Hassan El Ouazzani, B. P., 2020. Study of the Efficacy of Coagulation-flocculation Process in Domestic Wastewater Treatment Plant (WWTP) From the City of Hattane (MOROCCO). Jour of Adv Research in Dynamical & Control Systems, 12(7).

Heddam, S., Bermad, A., Dechemi, N., 2012. ANFIS-based modelling for coagulant dosage in drinking water treatment plant: a case study. Environmental monitoring and assessment, 184(4), Pp. 1953-1971.

Jackson, D. L., Gillaspy, J. A., Purc-Stephenson. R., 2009. Reporting practices in confirmatory factor analysis: An overview and some recommendations., Psychol. Methods, vol. 14, Pp. 6–23.

Jang, J., Sun, C., 1995. Neuro-Fuzzy modeling and control, IEEE Proc., 83, Pp. 378–406.

Kacha, A., Grenez. F., Orozco-Arroyave, J., Schoentgen, J. R., 2019. Principal component analysis of the spectrogram of the speech signal: Interpretation and application to dysarthric speech., Comput. Speech Lang.

Karnena, M. K., and Saritha, V., 2021. Water Treatment by Green Coagulants—Nature at Rescue. In Water Safety, Security and Sustainability Springer, Cham, Pp. 215-242

Katano, T., Shimura, T., Nomura, S., Iwai, T., Mizuno, Y., Yamada, T., Kataoka, H., 2021. Optimal definition of coagulation syndrome after colorectal endoscopic submucosal dissection: a post hoc analysis of randomized controlled trial. International Journal of Colorectal Disease, 36(7), Pp. 1479-1485.

Kaya Uyanık, G., and Güler, N., 2013. A Study on Multiple Linear Regression Analysis, Procedia – Soc. Behav. Sci., 106, Pp. 234–240

Lee, S.-I., Lee, J., and Hwang, B., 2019.Microstructure-Based prediction of yield ratio and uniform elongation in high-strength bainitic steels using multiple linear regression analysis, Mater. Sci. Eng.

Lek, S., Guégan, J. F., 1999. Artificial neural networks as a tool in ecological modelling, an introduction. Ecological modelling, 120(2-3), Pp. 65-73.

Li, H., Balaya, P., Maier, J., 2004. Li-storage via heterogeneous reaction in selected binary metal fluorides and oxides. Journal of the Electrochemical Society, 151(11), A1878.

Li, S., 2018. Design of the Next Generation Optical System for the SuperBIT Balloon-borne Telescope.

Libório, M. P., da Silva Martinuci, O., Machado, A. M. C., Machado-Coelho, T. M., Laudares, S., and Bernardes, P., 2020. Principal component analysis applied to multidimensional social indicators longitudinal studies: limitations and possibilities. GeoJournal, Pp. 1-16.

Mabrouki, J., Bencheikh, I., Azoulay, K., Es-soufy, M., El Hajjaji, S., 2019, April. Smart monitoring system for the long-term control of aerobic leachate treatment: dumping case Mohammedia (Morocco). In International Conference on Big Data and Networks Technologies Springer, Cham, Pp. 220-230.

Mabrouki, J., Moufti, A., Bencheikh, I., Azoulay, K., El Hamdouni, Y., El Hajjaji, S., 2019. July). Optimization of the Coagulant Flocculation Process for Treatment of Leachate of the Controlled Discharge of the City Mohammedia (Morocco). In International Conference on Advanced Intelligent Systems for Sustainable Development Springer, Cham, 200-212

Madhiarasan, M., and Deepa, S. N., 2017. Comparative analysis on hidden neurons estimation in multi layer perceptron neural networks for wind speed forecasting. Artificial Intelligence Review, 48(4), Pp. 449-471.

Madour, F., 2007. Controle neuro-flou robuste des systèmes non-linéaires, Université de Sétif Algérie.

Malekizadeh, M., Karami, H., Karimi, M., Moshari, A., Sanjari, M. J., 2020. Short-term load forecast using ensemble neuro-fuzzy model. Energy, 196, Pp. 117-127.

Menni, A., and Chaabane, D., 2017. Possibility-based optimization over an integer efficient set in fuzzy environment. Recueil des résumés, 34.

Mliless, M., and Azzouzi, L., 2020. Environmental Discourse in Moroccan Eco-documentary: The Decryption of Scientists’ Narratives. International Journal of Language and Literary Studies, 2(1), Pp. 199-217.

Moreno Cardenas, E. L., Zapata-Zapata, A. D., Kim, D., 2020. Modeling Dark Fermentation of Coffee Mucilage Wastes for Hydrogen Production: Artificial Neural Network Model vs. Fuzzy Logic Model. Energies, 13(7), 1663.

Muazu Musa, R., Abdul Majeed, P.P.A., Kosni, N. A., Abdullah, M. R., 2020. An overview of beach soccer, sepak takraw and the application of machine learning in team sports. Machine Learning in Team Sports, Pp. 1-12.

Naadimuthu, G., Liu, D. M., Lee, E. S., 2007. Application of an adaptive neural fuzzy inference system to thermal comfort and group technology problems,” Comput. Math. with Appl., 54 (11-12), Pp. 1395–1402.

Nauck, D., Kruse, R., 1997. What are Neuro-Fuzzy Classifiers?, University of Madenburg, Germany.

Ni, C., Wang, J., Guan, Y., Jiang, B., Meng, X., Luo, S., Wang, L., 2020. Self-powered peroxi-coagulation for the efficient removal of p-arsanilic acid: pH-dependent shift in the contributions of peroxidation and electrocoagulation. Chemical Engineering Journal, 391, Pp. 123495.

Nikzad, M., Movagharnejad, K., Talebnia, F., 2012. Comparative study between neural network model and mathematical models for prediction of glucose concentration during enzymatic hydrolysis. International Journal of Computer Applications, 56(1)

Oliveira, D. G., da Silva, E. M., Miranda, F. J., José Filho, F. S., and Parpinelli, R. S., 2020. October). Artificial Neural Network Model for Steel Strip Tandem Cold Mill Power Prediction. In International Conference on Applied Informatics, Springer, Cham. Pp. 29-42

Ouzerbane, Z., Aïfa, T., El Hmaidi, A., Essahlaoui, A., and Najine, A., 2021. A geoelectric study of aquifers in the Essaouira coastal region, Morocco. Journal of African Earth Sciences, 104309.

Ratnaweera, H., and Blom, H., 1995. Optimisation of coagulant dosing control using real-time models selective to instrumental errors. Water Supply, 13(3), Pp. 285-289.

Ringnér, M., 2008. What is principal component analysis?. Nature biotechnology, 26 (3), Pp. 303-304.

Rosemblatt, F., 1958. The perceptron : probabilistic model for information storage and organization on the brain psychological,” Review, 65, Pp. 386–408.

Sagir, A. M., and Abubakar, H., 2020, October. Enhanced sparse matrix approach in neural network algorithm for an effective intelligent classification system. In AIP Conference Proceedings (Vol. 2266, No. 1, p. 050010). AIP Publishing LLC.

Semerjian, L., Ayoub, G. M., 2003. High-pH–magnesium coagulation–flocculation in wastewater treatment. Advances in Environmental Research, 7(2), Pp. 389-403.

Shekofteh, H., Ramazani, F., 2017. Prediction of soil cation exchange capacity using support vector regression optimized by genetic algorithm and adaptive network-based fuzzy inference system. Desert, 22(2), Pp. 187-196.

Shi, Y., Song, X., Song, G., 2021. Productivity prediction of a multilateral-well geothermal system based on a long short-term memory and multi-layer perceptron combinational neural network. Applied Energy, 282, Pp. 116046.

Sihag, P., Tiwari, N. K., and Ranjan, S., 2019. Prediction of unsaturated hydraulic conductivity using adaptive neuro-fuzzy inference system (ANFIS). ISH Journal of Hydraulic Engineering, 25(2), Pp. 132-142.

Takagi, T., Sugeno, M., 1985. Fuzzy identification of systems and its application to modeling and control,” IEEE Trans. Syst. Man Cybern., 15, Pp. 116–132.

Tanaka, K. S. M., 1992. Stability Analysis and Design of Fuzzy Control Systems,” Fuzzy Sets Syst., 45, Pp. 135–156.

Taud, H., and Mas, J. F., 2018. Multilayer perceptron (MLP). In Geomatic Approaches for Modeling Land Change Scenarios. Springer, Cham. Pp. 451-455

Tranmer, M., Elliot, M., 2008. Multiple linear regression. The Cathie Marsh Centre for Census and Survey Research (CCSR), 5(5), Pp. 1-5.

Turner, R. K., Adger, N., and Doktor, P., 1995. Assessing the economic costs of sea level rise. Environment and Planning A, 27(11), Pp. 1777-1796.

Valentin, N., 2000. Construction of a software sensor for the automatic control of the coagulation process in drinking water treatment (Doctoral dissertation, Compiègne).

Vasile, O. E., 2009. Contribution au pronostic de défaillances par réseau neuro-flou : maîtrise de l’erreur de prédiction,
Verma, S. K., and Dutta, M., 2018. Mushroom classification using ANN and ANFIS algorithm. IOSR Journal of Engineering (IOSRJEN), 8 (01), Pp. 94-100.

Vieira, M. V., Oliveira, S. M., Amado, I. R., Fasolin, L. H., Vicente, A. A., Pastrana, L. M., Fuciños, P., 2020. 3D printed functional cookies fortified with Arthrospira platensis: Evaluation of its antioxidant potential and physical-chemical characterization. Food Hydrocolloids, 107,Pp. 105893.

Wang, X., Xu, J., Xu, M., Zhou, B., Liang, J., Zhou, L., 2021. High-efficient removal of arsenite by coagulation with titanium xerogel coagulant. Separation and Purification Technology, 258, Pp. 118047.

Wang, Y. A., and Rhemtulla, M., 2021. Power analysis for parameter estimation in structural equation modeling: A discussion and tutorial. Advances in Methods and Practices in Psychological Science, 4(1), 2515245920918253.

Wei, N., Zhang, Z., Liu, D., Wu, Y., Wang, J., Wang, Q., 2015. Coagulation behavior of polyaluminum chloride: Effects of pH and coagulant dosage. Chinese Journal of Chemical Engineering, 23(6), Pp. 1041-1046.

Wong, Y. J., Arumugasamy, S. K., Chung, C. H., Selvarajoo, A., Sethu, V., 2020. Comparative study of artificial neural network (ANN), adaptive neuro-fuzzy inference system (ANFIS) and multiple linear regression (MLR) for modeling of Cu (II) adsorption from aqueous solution using biochar derived from rambutan (Nephelium lappaceum) peel. Environmental monitoring and assessment, 192(7), Pp. 1-20.

Yan, M., Wang, D., Yu, J., Ni, J., Edwards, M., and Qu, J., 2008. Enhanced coagulation with polyaluminum chlorides: role of pH/alkalinity and speciation. Chemosphere, 71(9), Pp. 1665-1673.

Zaki, M. J., Meira, W. J., 1993. Data Mining and Analysis: Fundamental Concepts and Algorithms, Cambridge University Press.

Zheng, H., Zhu, G., Jiang, S., Tshukudu, T., Xiang, X., Zhang, P., and He, Q., 2011. Investigations of coagulation–flocculation process by performance optimization, model prediction and fractal structure of flocs. Desalination, 269(1-3), Pp. 148-156.

Pages 257-266
Year 2024
Issue 3
Volume 8