L’évacuation des eaux usées est un problème qui s’aggrave dans certaines zones rurales marocaines. Des rejets de phosphore et d’azote élevés peuvent entraîner l’eutrophisation des eaux réceptrices. Le processus biologique est l’alternative la plus adaptée aux besoins de ces zones, comme le système des filtres imbriqués (FI). Le procédé d’épuration des eaux usées en milieu rural par FI, un système innovant utilisé pour la première fois au Maroc, a été étudié en modélisant les relations entre un ensemble de facteurs environnementaux et le phosphore total éliminé, sur la base de 153 échantillonnages. Trois modèles pilotes de FI,  construites dans trois boîtes en plastique de 36 cm x 30 cm × 65 cm , ont été alimentés en continu par des eaux usées domestiques, avec un taux de charge hydraulique (HLR) de 250, 500 et 1000 l / m2/ jour. Cette étude a pour but d’étudier et de quantifier l’effet des paramètres affectant l’élimination biologique et physico-chimique du phosphore des eaux usées dans ce système, à l’aide de réseaux neuronaux (NN) et d’analyses de régression multiple (ARM). Les résultats montrent l’influence de la charge hydraulique (HLR), du potentiel hydrogène (pH), de la charge de phosphore (PL), du nitrite (NO2--N), de l’oxygène dissous (OD), de la demande biochimique d’oxygène (DBO5) et du nitrate (NO3--N) dans l’élimination du phosphore avec une contribution de 36, 16, 15, 12, 9, 7 et 6 % respectivement.

Mots clés: Analyse de régression multiple, filtres imbriqués, les réseaux de neurones, Phosphore.


Wastewater collection and disposal are still one of the most public health and environmental problems in Moroccan rural areas. Most of these areas lack wastewater collection systems and rarely have wastewater treatment plants (Latrach et al., 2016). Domestic wastewater treatment by the Multi-Soil-Layering (MSL) system showed a high adaptability to treat organic load and nutrients of domestic wastewater using local materials. As a low-cost wastewater treatment technology with fewer constraints of operation and maintenance, the MSL system could be considered an effective solution to be adopted for decentralized domestic wastewater treatment in Moroccan rural areas (Latrach et al., 2014). MSL systems use higher hydraulic load rates (HLR) and pollutant loads than some conventional soil systems by forming alternating structures inside to enhance the filtration ability of soil. This technique avoids many problems encountered in the conventional poorly functioning sewage treatment with soil (Yi-Dong et al., 2013). The MSL system reduces levels of organic matter and nutrients (Yi-Dong et al., 2012). The system is also characterized by several typical benefits such as less frequent clogging, small area demand, the application of high HLR, simple maintenance and an effective life that was estimated to be longer than 20 years for domestic wastewater treatment (Chen et al., 2008).

Research showed that the MSL system reduced the concentration of all parameters. For suspended solids, the mean removal efficiency was about 93%. For organic matter, the mean removal percentages were 86 and 81% respectively for BOD5 and COD. The elimination of organic matter is achieved through biological degradation under oxygenated conditions in the porosity of the MSL system. The mean efficiencies of NH4+-N, NO2–-N, NO3–-N, TKN and TN were 86, 62, 71, 82 and 78%, respectively. Concerning P removal, the results also showed that the MSL system was very effective in removing PO4–-P and TP with the same mean removal percentages of 81 and 80%, respectively (Latrach et al., 2014).

The MSL system consists of soil mixture blocks (SMB) arranged in a brick-like pattern and surrounded by permeable gravel layers (PL). The SMB comprised sandy soil, charcoal, sawdust and metal iron at a dry weight ratio of 7:1:1:1 (Lamzouri et al., 2016).

Currently, the majority of treatment plants incorporating P-removal utilize chemical precipitation using alum or lime. Biological removal systems are however increasingly being incorporated in sewage treatment works (Stratful et al., 1999).

Different phosphorus removal investigations were performed in the MSL system and showed excellent performance with over 80 % of total phosphorus (TP) removed, without evaluating and quantifying the various parameters influencing the TP removal. Hence, the objective of this study is to investigate and quantify the effect of parameters affecting biological and physicochemical phosphate removal from wastewaters in a MSL system, using neural networks (NNs) and multiple regression analysis (MRA).


Description of experimental conditions

Figure 1 (Lamzouri et al., 2016) shows a detailed description of the structures of the MSL systems used in this study, with different HLR of 250, 500 and 1000 l/m2/day. The three MSL systems evaluated in this study were packed in three individual 36 cm × 30 cm × 65 cm plastic boxes. The MSL system is typically composed of soil mixture blocks (SMB) arranged in a brick-like pattern and surrounded by water-layers (PL), gravel particles, with a diameter ranging from 3 to 5 mm. The SMB was composed of soil, charcoal, sawdust and granular iron metal at a ratio of 7:1:1:1 on a dry-weight basis and packed.

The three pilots systems were installed at the Talat Marghen village of the Aghouatim rural located near Marrakech (Morocco) and continuously fed by domestic wastewater. Domestic wastewater come from eight houses (72 inhabitants) and collected by a holding tank with a volume of 1 m3 which is used to feed the MSL pilots plant.

Figure 1: Structure of MSL system

The mode of operation of the MSL is based on the percolation-infiltration using the soil as purification means. The absorption, infiltration and biodegradation are the major processes occurring in the filter.

Sampling and analyses

The experiment data consisted of 153 sampling. The influent and effluent of each system were analyzed for pH, Temperature (T), Electrical Conductivity (EC), Dissolved Oxygen (DO), Total Suspended Solids (SS), Biochemical Oxygen Demand (BOD5), Chemical Oxygen Demand (COD), Ammonium (NH4+), nitrite (NO2-), nitrate (NO3-), Total Kjeldahl Nitrogen (TKN), Total Nitrogen (TN) and Total Phosphorus (TP).Wastewater and treated water were collected at almost the same time once every two week using plastic bottles for chemical assays, and in sterile glass bottles for bacteriological studies. Samples were analyzed according to Standard Methods (Rodier, 2009; AFNOR, 1997). The experiment was conducted for about a year, from 24 July 2014 to 16 June 2016.

Analysis of the experimental data

The exploratory analysis of experimental data frequently used statistical tools. In this study, we analyzed the physical and chemical data by a linear modeling with MRA. The non-mathematical significance of the results led us to model the output TP depending on other input variables by NNs method. This article presents detailed applicability of artificial neural networks (ANNs) and their contribution to the study of the evaluation of the phosphorus pollution output using the MSL.

Linear analysis of the physical and chemical data by multiple linear regression (MLR)

The established relationships between environmental parameters and TP were carried out using the Principal Component Analysis (PCA) and MRA. Both methods aim at providing the equations describing the relationship between the parameters influencing the treated wastewater.

Nonlinear analysis of the physical and chemical data by ANNs

By training a nonlinear system of multiple variables, ANN can predict the independent variable (Huang et al., 1996).Consequently; ANNs approximate technical systems complexes, which are difficult to model by conventional statistical methods.

The established relationships between environmental parameters and TP were carried out using the NNs technique. The analysis of physical-chemical data used to create the model of the ANN providing TP removal by the MSL system were analyzed using the STATISTICA neural network software version 4.0.

As there is a large number of structures of ANN, it was necessary to choose an appropriate NNs development for this study. We started our train NNs system by varying parameters that significantly influence the results of predicting such as architecture of ANN, the activation function, number of hidden unit and the number of iterations. To determine the best network parameters (number of hidden neurons, activation function, number of iterations, etc.) which gives a satisfactory prediction, we made a series of tests for the number of hidden neurons between 1 and 5, with different activation function possible, architecture and algorithm, which are governed by the iterations of from 10 to 40. The optimized NN model used in this work has three layers: an input layer consisting of the environmental parameters, a hidden layer having four neurons and one unit in the output layer representing TP concentration.

Finally, we analyzed the RMS and the R² to choose the best model taking into account issues of performance and generalization.

Mathematically, as illustrated in figure 2, each neuron receives input vector form, then calculates a weighted sum of its inputs so that the result is then passed through the activation function to create an exit.

Figure 2: Typical architecture of the NN


Effect of environmental factors on TP removal using linear model

After calculating the correlation coefficients between the input parameters to reduce the number of input values and refine linear regression, using the PCA, we moved on to the second part of the series of statistical analysis of the data using the method of MRA. The uncorrelated parameters used in the MRA are HLR, pH, TP, BOD5, OD, NO2- and NO3-.

Two criteria were used to evaluate the performance of models: R² and the S.

The best found MRA model, is given below (Equation 1):

TPo (mg/l) = - 0.35 pH +0.31 TPi+ 0.86 HLR

TPo: output total phosphorus

pH: Hydrogen potential

TPi: input total phosphorus

HLR: Hydraulic Loading Rate

The statistical parameters of the model are: n = 153, R² = 0.60, S = 0.87

Effect of environmental factors on TP removal using Nonlinear analysis

We considered all uncorrelated parameters cited above, and using ANNs, the architecture of the best model obtained is as follow:

• MLP 7-4-1,

• Activation function: Sinus,

• Architecture: Multilayer Perceptron (MLP),

• Algorithm: Broyden-Fletcher-Goldfarb-Shanno (BFGS).

The statistical parameters used to evaluate the performance of the model are: RMS and S.

After optimization (30 cycles) of the weights of connections (Table 1), we obtained a model for which the predicted and observed values of TP are highly correlated (R²= 0.72). The configuration of the NN was 7 – 4 – 1. The statistical parameters of the model are: n = 153, R² = 0.72, RMS = 0.87.

Table 1: Weight of connections between neurons

* Biochemical Oxygen Demand (BOD5), Hydrogen potential (pH), Dissolved Oxygen (DO), nitrite (NO2-), nitrate (NO3-), input total Phosphorus (TPi) and Hydraulic Loading Rate (HLR)

Measured and predicted values of TP by MRA and NNs are illustrate in figure 3.

We attempted to evaluate the contribution of each environmental parameter to the whole model. We also calculated the contribution of variables of equation according to the Gore method (Gore, 1952). Results are reported in table 2.

It is the first time we can quantify the effect of each environmental parameter on TP removal. Comparing the two models found by MRA and NNs, we note, first, that the three parameters HLR, pH and TPi appears in both models, with different proportions, 57%, 23%, and 20% in the linear model, while are 36%, 16% and 15% in the non-linear model, which we add 12%, 9%, 7% and 6% of NO-2, OD, BOD5 and NO-3, that appear respectively only in NN model. Moreover, the correlation coefficient obtained by MRA of 0.60 is too low, whereas that obtained by NN is 0.72, this indicates that the result is satisfactory, and that the model which explains better the behavior of the MSL is not linear.

According to the results, we can conclude that the second is statistically valid with a RMS less than 0.87 and a R² of 0.72 confirming that our model is strong.

The contribution of HLR, pH, TPi, NO-2, OD, BOD5 and NO-3 were 36, 16, 15, 12, 9, 7 and 6% respectively. Our results explain and confirm mathematically those obtained in previous works. Firstly, and as reported by Sato et al., (2005), an increase in the HLR reduced the hydraulic retention time in the MSL system, which resulted in the decrease in the pollution removal percentage. According to our results we note that the hydraulic load influences of 36% the percentage of phosphorus removal (PR). indeed, the increase in the hydraulic load decreased hydraulic retention time and hence, the removal rate of the phosphorus pollution. The effect of the HLR on the concentration of PR is illustrated in the figure 4.

Secondary, the initial phosphorus concentration also had an effect on the rate of PR. Indeed, one of the major factors influencing the percentage of PR with 15% appears to be the phosphorus load. Mulkerrins et al., (2004) confirmed that the majority of studies on biological phosphorus removal (BPR) have been carried out on low-phosphate wastewaters, with few attempts to apply biological systems for influents containing >20 mg P/l. It has been proposed that limited phosphate loadings may suppress the development of phosphate accumulating organisms (PAO) (Sudiana et al., 1999).

Finally, more recent investigations have made clear that the BPR is influenced by several parameters such as carbon pollution, hydrogen potential, dissolved oxygen, nitrite and nitrate, parameters that appeared in our NNs model. In fact, and according to Wakatsuki et al., (1993), phosphorus can be adsorbed on the Al and Fe hydroxides in the soil. The iron added in the SMB is transformed into ferrous iron (Fe2+), which is subsequently translocated to the zeolite interlayer and is oxidized to ferric ion (Fe3+), which aids in associating co-precipitation of PO43- from the percolating wastewater. However, and based on our findings, we can conclude that in parallel to the removal of phosphorus by precipitation, there is a BRP into the MSL system, where microorganisms remove phosphorus biologically. Over the last decades, the discovery of denitrification phosphate accumulating organisms (DPAO) has been extensively reported. These organisms, as conventional Poly-P bacteria, could sequester organic substrates under anaerobic condition, Instead, they utilize nitrate or nitrite as electron acceptor to accumulate phosphate (Zouet al., 2014; Zhang et al., 2011). As an alternative to conventional nitrogen and phosphorus removal, denitrifying dephosphatation could overcome the limitation of low organic carbon. In addition, denitrifying dephosphatation can result in decreases in oxygen requirement and sludge production of about 30% and 50%, respectively, over conventional processes (Kuba et al., 1996b). Denitrifying dephosphatation is based on the activity of denitrifying phosphate-accumulating organisms, which could be subdivided into two groups (Hu et al., 2003). One group, denitrifying phosphate-accumulating organisms over nitrate (DPAOs), can use both oxygen and nitrate as electron acceptor; the other group, denitrifying phosphate-accumulating organisms over nitrite (DNPAOs), can use oxygen, nitrate and nitrite as electron acceptor. Wang et al., (2007) highlighted that anoxic phosphorus uptake can be achieved successfully when initial nitrite concentrations are 5.5 and 9.5 mg/L. However, increasing nitrite concentration up to 15 mg/l results in the inhibition of anoxic phosphorus uptake. This indicates that nitrite can serve as an alternative electron acceptor for anoxic P-uptake if only nitrite concentration is controlled under the threshold value, which mainly depends on the sludge condition. Regarding the effect of the hydrogen potential, Smolders et al., (1994) reported that the rate of P-release under anaerobic conditions was increased as the pH was increased. Similarly, Bond et al., (1998) showed that an SBR operated without pH control in the anaerobic phase exhibited an improved P-removal by comparison with an SBR, which had pH control. Absence of pH control resulted in an increase in the prevailing pH of the anaerobic phase. Liu et al. (1996) reported that an acidic pH had a negative effect on both acetate uptake and P-release in the anaerobic stage, whereas a more alkaline pH inhibited the uptake of acetate and stimulated more P-release than at acidic pH. Furthermore, it has been observed that the pH does affect the anaerobic P-release and anoxic P-uptake significantly. A rapid pH increase (even up to 8), has been observed during the anoxic phosphorus uptake period. Thus, pH should be strictly controlled below 8.0 to avoid chemical precipitation if the biological denitrifying phosphorus removal phenomena are to be studied accurately (Wang et al., 2007). A combined BNR process has to satisfy, also, many different oxygen demands from the bacterial populations present in the system ((Mulkerrins et al., 2004). It has also been reported that for successful BPR, a DO concentration of 2.0 mg/l is required, but when nitrification is also necessary, a DO of 3.0–4.0 mg/l is essential. Since DO concentrations of >4 mg/l do not appear to further stimulate BNR, the maintenance of oxygen concentrations above this level represents a waste of energy for aeration purposes. A study by Brdjanovic et al., (1998) revealed that excessive aeration negatively affects the BPR process. Different investigation showed also that the ratio of phosphorus to total organic carbon (P/TOC) in a system is important in the selection of the PAO bacteria and in giving them a competitive advantage (Liu et al., 1997, 1998). When a low P/TOC feeding ratio was used by Liu et al., (1998), growth of PAO was suppressed. In contrast, higher P/TOC feeding ratios encouraged the growth of PAO over accumulation of the glycogen accumulating organisms (GAO).


According to the obtained results, we conclude that nonlinear models are the adapted tool to account for the relationships between environmental factors and the MSL process of wastewater treatment. The main environmental parameters affecting the removal rate of phosphorus, according to modelling using NN models , are HLR, pH, TPi, NO-2, OD, BOD5 and NO-3 of the inflow wastewater, with a contribution of 36, 16, 15, 12, 9, 7 and 6% respectively. In order to operate a successful phosphate removal process, it is imperative that the incoming wastewater contain the correct balance of this parameters, as discussed in this research.

This established model could be used as tool in the control of the treatment quality by MSL. Indeed, we were able to identify and quantify the key wastewater composition parameters which influence the phosphate removal from wastewaters. These parameters are the most important controls that must be optimized and monitored for an efficient removal rate of phosphorus.


AFNOR (1997). Recueil de norme française: Eau, méthodes d’essai (Collection of French standard: water, testing methods) , Paris.

Bond P.L., Keller J., Blackall L.L. (1998). Characterisation of enhanced biological phosphorus removal activated sludges with dissimilar phosphorus removal performances. Water Sci. Technol., 37:567– 71.

Brdjanovic D., Slamet A., van Loosdrecht M.C.M., Hooijmans C.M., Alaerts G.J., Heijnen J.J. (1998).Impact of excessive aeration on biological phosphorus removal from wastewater, Water. Res. 32:200–8.

Chen X., Luo A.C., Sato K., Wakatsuki T., Masunaga T. (2008). An introduction of a multi-soil-layering system: a novel green technology for wastewater treatment in rural areas. Water Environ. J. 4: 255-262.

Gore W. L. (1952). Statistical methods for chemical experimentations, Interscience, New York.

Hu. J.Y., Ong, S.L., Ng, W.J., Lu, F., Fan, X.J. (2003). A new method for characterizing denitrifying phosphorus removal bacteria by using three different types of electron acceptors. Water Res. 37: 3463–3471.

Huang Z., Shimeld J., Williamson M., Katsube J.(1996). Permeability prediction with artificial neural network modeling in the V enture gas field, offshore eastern Canada. Geophysics 61: 422-436.

Kuba T., Van Loosdrecht, M.C.M., Heijnen, J.J.(1996). Phosphorus and nitrogen removal with minimal COD requirement by integration of denitrifying dephosphatation and nitrification in a two-sludge system. Water Res. 30:1702–1710.

Lamzouri K., Mahi M., Ouatar S., Bartali E., Masunaga T., Latrach L., Mandi L. (2016). Application of Multi-soil-layering technique for wastewater treatment in Moroccan rural areas: study of the operation process for an engineering design. J. Mater. Environ. Sci. 7: 579-585.

Latrach L., Masunaga T., Ouazzani N., Mahi M., Mandi L. (2014). Removal of bacterial indicators and pathogens from domestic wastewater by the multi-soil-layering (MSL) system. Soil Sci. Plant Nutr. 61:337-346.

Latrach L., Ouazzania N., Masunaga T., Hejjaja A., Bouhoumb K., Mahi M., Mandi L. (2016). Domestic wastewater disinfection by combined treatment usingmulti-soil-layering system and sand filters (MSL–SF): A laboratorypilot study. Ecol. Eng. 91: 294–301

Liu W.T., Mino T., Matsuo T., Nakamura K. (1996). Biological phosphorus removal process—effect of pH on anaerobic substrate metabolism. Water Sci. Technol. 34: 25-32.

Liu W.T., Mino T., Nakamura K., Matsuo T. (1997). Internal energy-based competition between polyphosphate- and glycogen-accumulating bacteria in biological phosphorus removal reactors-effect of P/C feeding ratio. Water Res. 31:1430– 8.

Liu W.T., Marsh T.L., Forney L.J. (1998). Determination of the microbial diversity of anaerobic - aerobic activated sludge by a novel molecular biological technique. Water Sci. Technol. 37:417–22.

Mulkerrins D., Dobsona A.D.W., Colleran E.(2004). Parameters affecting biological phosphate removal from wastewaters. Environ. Int. 30: 249–259.

Rodier J. (1996). L’analyse de l’eau: eaux naturelles, eaux résiduaires, eau de mer (Analysis of water: natural water, waste water, sea water) , Dunod, Bordas, Paris, pp: 1365.

Sato K., Masunaga T., Wakatsuki T. (2005). Water Movement Characteristics in a Multi-Soil- Layering System. Soil Sci. Plant Nutr. 61: 75–82.

Smolders G.J.F, van Loosdrecht M.C.M., Heijnen J.J. (1994). pH: key factor in the biological phosphorus removal process. Water Sci. Technol. 29: 71– 4.

Stratful I., Brett S., Scrimshaw M.B., Lester J.N. (1999). Biological phosphorus removal, its role in phosphorus recycling. Environ. Technol. 20: 681– 95.

Sudiana I.M., Mino T., Satoh H., Nakamura K., Matsuo T. (1999). Metabolism of enhanced biological phosphorus removal and non-enhanced phosphorus removal sludge with acetate and glucose as carbon source. Water Sci. Technol. 39 29 –35.

Wakatsuki T., Esumi H., Omura S. (1993). High Performance and N&P Removal On-Site Municipal Wastewater Treatment System by Multi-Soil-Layering Method. Water Sci. Technol. 27: 31–40.

Wang Ya-yi, PAN Mian-li, YAN Min, PENG Yong-zhen, WANG Shu-ying (2007). Characteristics of anoxic phosphors removal in sequence batch reactor. Journal of Environ. Sci. 19:776–782.

Yidong G., Xin C., Shuai Z., Ancheng L. (2012). Performance of multi-soil-layering system (MSL) treating leachate from rural unsanitary landfills. Sci. Total Environ. 420: 183– 190.

Yi-Dong G., De-Fu X., Xin C., An-Cheng L., Hua F., Yu-Zhi S. (2013) Flow patterns of multi-soil layering systems. Desalin.Water Treat. 52: 4165-4169.

Zhang YB., Xing Y.B. , Qin S.F. , Quan X. , Chen S . (2011)Optimization and stability of denitrifying-phosphorus removal in a two-sludge system for treating wastewater with low carbon source. Environ. Sci. 32: 20-26.

Zou H., Lu X., Abualhail S. (2014). Characterization of denitrifying phosphorus removal microorganisms in a novel two-sludge process by combining chemical with microbial analysis. Journal of Chemistry. 360-503.