Freshwater Algal Bloom Prediction by Support Vector Machine in Macau Storage Reservoirs

Understanding and predicting dynamic change of algae population in freshwater reservoirs is particularly important, as algae-releasing cyanotoxins are carcinogens that would affect the health of public. However, the high complex nonlinearity of water variables and their interactions makes it difficult to model the growth of algae species. Recently, support vector machine SVM was reported to have advantages of only requiring a small amount of samples, high degree of prediction accuracy, and long prediction period to solve the nonlinear problems. In this study, the SVM-based prediction and forecast models for phytoplankton abundance in Macau Storage Reservoir MSR are proposed, in which the water parameters of pH, SiO2, alkalinity, bicarbonate HCO3 − , dissolved oxygen DO , total nitrogen TN , UV254, turbidity, conductivity, nitrate, total nitrogen TN , orthophosphate PO4 3− , total phosphorus TP , suspended solid SS and total organic carbon TOC selected from the correlation analysis of the 23 monthly water variables were included, with 8-year 2001–2008 data for training and the most recent 3 years 2009–2011 for testing. The modeling results showed that the prediction and forecast powers were estimated as approximately 0.76 and 0.86, respectively, showing that the SVM is an effective new way that can be used for monitoring algal bloom in drinking water storage reservoir.


Introduction
Freshwater algal bloom is one of water pollution problems that occurs in eutrophic lakes or reservoirs due to the presence of excessive nutrients.It has been found that most species of algae also called phytoplankton can produce various cyanotoxins including microcystins, cylindrospermopsis, and nodularin, which have a direct impact on the water treatment processes and consequently the health of public 1 .Thus, it is of great importance to understand the population dynamics of algae in the raw water storage units.However, modeling the algae population in such a complicated system is a challenge, as the physical, chemical, and biological processes as well as the interaction among them are involved, resulting in the highly nonlinear relationship between phytoplankton abundance and various water parameters.
Computational artificial intelligence techniques have been developed as the efficient tools in recent years for predicting without considering time series effect or forecasting considering time series effect algal bloom.Previous studies 2 have used the principle component regression PCR , that is, principal component analysis PCA followed by multiple linear regression MLR , to predict chlorophyll-a levels, the fundamental index of phytoplankton.However, the intrinsic problem of PCR is that the variables dataset used as the input of the model has high complex nonlinearity, expecting that PCR alone is inadequate for prediction, and the prediction results were unsatisfactory.With the development of artificial intelligence models, artificial neural network ANN such as backpropagation BP was applied to predict the algal bloom by assessing the eutrophication and simulating the chlorophyll-a concentration.ANN is a well-suited method with self-adaptability, selforganization, and error tolerance, which is better than PCR for nonlinear simulation.However, this method has such limitations as requirement of a great amount of training data, difficulty in tuning the structure parameter that is mainly based on experience, and its "black box" nature that makes it difficult to understand and interpret the data 2, 3 .
Considering the drawbacks of both the methods, recently support vector machine SVM started to be used for predicting the chlorophyll concentration.It is a new machine-learning technology based on statistical theory and derived from instruction risk minimization, which can enhance the generalization ability and minimize the upper limit of generalization error.Compared to ANN, SVM has advantages of only requiring a small amount of samples, high degree of prediction accuracy, and long prediction period by using kernel function to solve the nonlinear problems.It is believed that SVM will provide a new approach for predicting the phytoplankton abundance in the reservoirs 4 .Also, this black box model can be applied in other locations and other cases such as red tide.
In this study, we attempted to develop an SVM-based predictive model to simulate the dynamic change of phytoplankton abundance in Macau Reservoir given a variety of water variables.The measured data from 2001 to 2011 were used to train and test the model.The present study will lead to a better understanding of the algal problems in Macau, which will help to develop later guidelines for forecasting the onset of algae blooms in raw water resources.

Materials and Methods
Macau is situated 60 km southwest of Hong Kong and experiences a subtropical seasonal climate that is greatly influenced by the monsoons.The difference of temperature and rainfall between summer and winter is significant though not great.Macau Main Storage Reservoir MSR Figure 1 , located in the east part of Macau peninsula, is the biggest reservoir in Macau with the capacity of about 1.9 million m 3 and the water surface area of 0.35 km 2 .It is a pumped storage reservoir that receives raw water from the West River of the Pearl River network and can provide water supply to the whole areas of Macau for about one week.MSR is particularly important as the temporary water source during the salty tide period when high salinity concentration is caused by intrusion of sea water to the water intake location.In recent years, there were reports Macao Water Supply Co. Ltd, unpublished data that the reservoir experienced algal blooms, and the situation appeared to be worsening.− , total nitrogen TN , phosphorus PO 4 3− , total phosphorus TP , suspended solid, total organic carbon TOC and UV 254 , and iron Fe were measured according to the standard methods 5 .The phytoplankton samples were fixed using 5% formaldehyde and transported to laboratory for microscopic counting.
In this work, correlation analysis was conducted to identify the water parameters which were significantly correlated with phytoplankton abundance Table 1 .Only the parameters with the correlation coefficients greater than 0.3 are selected as inputs in the SVM models.It was also noted that the parameters selected in forecast models are different from those in the prediction models, as the water parameters in previous data were also used in the correlation analysis.
As a prediction algorithm, SVM was firstly proposed by Vapnik 6 and is an effective tool for data classification and regression.The SVM is fundamentally based on Mercer core expansion theorem which maps sample space to a higher-dimension or even unlimited dimension feature space by nonlinear mapping functions kernel function 7 .In SVM, it transforms the problem of searching for an optimal linear regression hyperplane to a convex programming problem of solution for a convex restriction condition.Moreover, SVM can provide the global optimum solution because the problem in SVM is transformed to finding the solution to the quadratic programming.SVM is selected in this work because of its advantages over other "black box" modeling approaches such as ANN as listed as follows 8 .
1 The architecture of the estimated function does not have to be determined before training.Input data of any arbitrary dimensionality can be treated with only linear costs in the number of input dimensions.
2 SVM treats the regression as a quadratic programming problem of minimizing the data-fitting error plus regularization, which produces a global or even unique solution.
3 SVM combines the advantages of multivariate nonlinear regression in that only a small amount of data is required to produce a good generalization.In addition, the weakness of the transformational models in multivariate nonlinear regression can be overcome by mapping the data points to a sufficiently high-dimensional feature space.
4 Results obtained from SVM are easy to interpret.
In SVM, the whole process consists of several layers.The input vectors are put in the first layer.Suppose that the training datasets are 2.1 A nonlinear mapping ψ • is used to map samples from former space R n to feature space 9 : Then, in this higher-dimension feature space, optimal decisions function is where b is the bias constant or the threshold which can be calculated as introduced in 8 .In this way, nonlinear prediction function is transformed to linear prediction function in higher-dimension feature space 9 .Note that parameters used in equations will be introduced later in this section.The SVM needs to find out the solution to minimize the following functional:

2.4
As introduced previously, SVM can provide the global optimum solution because the problem in SVM is transformed to finding the solution to the quadratic programming.So,

Mathematical Problems in Engineering
According to Mercer's condition, in SVM the inner product φ x , φ x i can be defined through a kernel function K x, x i .There are several kernel functions that are available as follows: x T i x j , 2 polynomial: K x i , x j γx T i x j r d , 3 radial basis function: K x i , x j exp −γ x i − x j 2 , 4 sigmoid: K x i , x j tanh γa T i r .
For these four kernel functions, in general, the RBF kernel function is a reasonable first choice 9 .This kernel function nonlinearly maps samples into a higher-dimensional space.So, unlike the linear kernel, it can handle the case when the relation between class labels and attributes is nonlinear.The second reason is that the RBF kernel function has a less number of hyperparameters which influences the complexity of model selection.Finally, the RBF kernel has fewer numerical difficulties 12-16 .
As shown in the kernel function mentioned previously, there are three parameters which need to be specified in the application of SVM: 1 capacity parameter C that controls the trade-off between maximizing the margin and minimizing the training error.If C is too small, then insufficient stress will be placed on fitting the training data.If C is too large, then the algorithm will overfit the training data. 2 RBF width parameter γ: the γ value is important in the RBF model and can lead to under-or over-fitting in prediction.A very large value of γ may lead to overfitting, and all the support vectors distances are taken into account, while in case of a very small γ, the machine will ignore most of the support vectors leading to failure in the trained point prediction 9 .3 Insensitive loss function ε: if ε is too large, then it will result in less support vectors, and consequently, the resulting regression model may yield large prediction errors on unseen future data 10 .In this work, in order to prevent overtraining, an internal cross-validation 11 during construction of SVR models is adopted to have a good combination of the three parameters C, γ, and ε.Now, after the introduction of SVM, the following section gives the numerical results from the application of SVM.
With the above introduction of SVM, it is necessary to present performance indicators.The performance of models was evaluated using the following indicators: square of correlation coefficient R 2 that provides the variability measure for the data reproduced in the model; mean absolute error MAE and root mean square error RMSE that measure residual errors, providing a global idea of the difference between the observation and modeling.The indicators were defined as follows:  where n is the number of data; Y i and Y i are observation data and the mean of observation data, respectively, and Y i is the modeling results.

Results and Discussion
The correlation of log 10 phytoplankton and water parameters for forecast model and prediction model was shown in Table 2. Parameters with correlation coefficients greater than 0.3 highlighted in bold will be retained in the models.It was also noted that the parameters selected in forecast models are different from those in the prediction models, as the water parameters in previous data past record were also used in the correlation analysis.In the forecast models of SVM, phytoplankton abundance t is a function of water parameter t-1 , water parameter t-2 , and water parameters t-3 , where t-1, t-2, and t-3 represent the 1 month, 2 months, and 3 months prior to time t.Thus, there were only 9 parameters used in the prediction models and 23 time-lagged parameters selected for the forecast models.
After the correlation analysis, it comes to the testing of the models invoked two parts, the accuracy performance and the generalization performance.Accuracy performance is to test the capability of the model to predict the output for the given input set that is originally used to train the model, while generalization performance is to test the capability of the model to predict the output for the given input sets that were not in the training set.In order      to prevent the model that is memorizing the inputs instead of generalized learning, both performance checks need to be considered.In the present research, the performance indexes for SVM-based models were averaged with 50 runs.
In the application of SVM in this work, for the predication model, after the correlation analysis, 9 parameters such as pH, SiO 2 are selected as the independent variables, and phytoplankton abundance is selected as the induced variable target value .Then, the data from May 2005 to December 2008 are used to train the model, and data from January 2009 to February 2011 are used to test the model.In the training process, the crossvalidation approach as mentioned previously is adopted to obtain the optimal combination of parameters for the testing.Specifically, the training data are divided into 10 about the same size groups that are 9 groups for training, and the rest 1 group is used to test the model trained by the previous 9 groups' data.Then, this 9 groups training and 1 group testing is repeated for 9 times 10 times in total .And then, parameters of the one process which has the best testing performance in these 10 repeats will be used as the optimal parameters combination in the "real" testing process which has the data from January 2009 to February 2011.The forecast model basically follows the same steps of the prediction model, while the only difference between these two models is that effect of time series which is included in the forecast model.So, in the forecast model, only the previous three months' data are included in the training process.
The performance of prediction and forecast models was shown in Table 2. Compared to our previous studies using ANN, the SVM has a similar performance for prediction model with R 2 of 0.758, RMSE of 0.351, and MAE of 0.274, while it has much better performance for forecast model with R 2 of 0.863, RMSE of 0.229, and MAE of 0.127, for testing.To balance the R 2 in training and testing, we defined the equal values for both data sets as the performance of the models.The observed data versus the modeling data were shown in Figures 4 and 7, and the observed and modeling phytoplankton abundance changes over time were listed in Figures 2, 3, 5, and 6.
These results confirmed that SVM can handle well the nonlinear relationship between water parameters and phytoplankton abundance.

Conclusions
The SVM-based prediction and forecast models for phytoplankton abundance in MSR are proposed in this study.15 water parameters with the correlation coefficients against phytoplankton abundance greater than 0.3 were selected, with 8-year 2001-2008 data for training and cross-validation and the most recent 3 years 2009-2011 for testing.The results showed that the forecast model has better performance with the R 2 of 0.863 than prediction model with the R 2 of 0.760, implying that the algal bloom problem is a complicated nonlinear dynamic system that is affected not only by the water variables in current month, but also by those in a couple of previous months.In addition, compared to ANN in our previous studies, SVM in the study showed superior forecast power, while similar prediction power in terms of regression coefficient.These results will provide an effective way for water quality monitoring and management of drinking water storage reservoirs.In addition, additional numerical approaches and optimization algorithms can be applied to enhance the performance 17-19 .

Figure 1 :
Figure 1: Location of the MSR.

Figure 2 :
Figure 2: Observed and predicted phytoplankton level for the training and validation dataset of the prediction models.

10 Figure 3 :
Figure 3: Observed and predicted phytoplankton level for the testing dataset of the prediction models.

R 2 =R 2 =Figure 4 :
Figure 4: SVM result for the training and validation a and testing b data set.

Figure 5 :
Figure 5: Observed and predicted phytoplankton level for the training and validation dataset of the forecast models.

Figure 6 :
Figure 6: Observed and predicted phytoplankton level for the testing dataset of the forecast models.

R 2 =Figure 7 :
Figure 7: SVM result for the training and validation a and testing b data set.

Table 1 :
Correlation analysis of prediction and forecast model.

Table 2 :
Performance indexes of the prediction and forecast models.