Water quality forecast through application of BP neural network at Yuqiao reservoir Water quality forecast through application of BP neural network at Yuqiao reservoir

Water quality forecast through application of BP neural network at Yuqiao reservoir

  • 期刊名字:浙江大学学报A(英文版)
  • 文件大小:896kb
  • 论文作者:ZHAO Ying,NAN Jun,CUI Fu-yi,GU
  • 作者单位:School of Municipal and Environmental Engineering
  • 更新时间:2020-07-08
  • 下载次数:
论文简介

1482Zhao et al. 1 J Zhejiang Univ SciA 2007 8(9):1482-1487Journal of Zhejang University SCIENCE AISSN 1673-565X (Print); ISSN 1862-1775 (Online)www.zju. edu cnjzus; www springerink comJzusE-mal: jzus@zju.edu.cnW ater quality forecast through application ofBP neural network at Yuqiao reservoirZHAO Ying', NAN Jun, CUI Fu-yi, GUO Liang(School of Municipal and Environmental Engineering. Harbin lnstitute of Technology. Harbin 150090, China)E-mail: zhaoying@hit.edu.cnReceived Dec. 26. 2006; revision acepted Apr. 9, 2007Abstract: This paper deals with the study of a water quality forecast model through application of BP neural network techniqueand GUI (Graphical User Interfaces) function of MATLAB at Yuqiao reservoir in Tianjin. To overcome the shortcomings oftraditional BP algorithm as being slow to converge and easy to reach extreme minimum value, the model adopts LM (Leven-berg-Marquardt) algorithm to achieve a higher speed and a lower eror rate. When factors afecting the study object are ientifed,the reservoir's 2005 measured values are used as sample data to test the model. The number of neurons and the type of transferfunctions in the hidden layer of the neural network are changed from time to time to achieve the best forecast results. Throughsimulation testing the model shows high efciency in forecasting the water quality of the reservoir.Key words: Water quality forecast, BP neural network, MATLAB, Graphical User Interfaces (GU)doi: 10.163 1/jzus.2007.A1482Document code: ACLC number: TU991INTRODUCTIONquality in addition to the restriction and standardiza-tion of development in farming and fishery in theThe Yuqiao reservoir covers a flow area of 2060proximity of the reservoir. As a result, this paperkm' with a total storage capacity of 1.559x10* m'. It studies water quality forecast at Yuqiao reservoir tois the only reservoir in Tianjin that incorporatesgain better understanding of possible water qualityvarious functions including flood control, urban water changes in the future. The study will provide scien-supply, irrigation, power generation and aquaculture.tific evidences for water quality management andIt is also a key regulating reservoir for the Diversionpropose necessary action to foresee and prevent anyProject from Luanhe River to Tianjin and plays a future problems, thus playing a positive role in se-major role in securing the economic growth ofTianjincuring the safety of water supply in Tianjin.and the life and property of the people living in theIn recent years, many researches have been con-lower region. However in recent years, along with theducted on water quality forecast model (Chen et al.,development of farmland frillization and fishery in2003; Kurunc et al., 2005; Li, 2006). However, asthe area, the content of nitrogen and phosphorus in thewater quality can be affected by so many factors,water keeps rising, resulting in massive reproductiontraditional data processing methods are no longerof undesirable water bodies such as fungus andgood enough for solving the problem (Wu et al.. 2000;waterweeds and their over-nutrition. To ensure the Xiang et al, 2006) as such factors show a compli-safety of drinking water, it is important to initiate acated nonlinear relation to the variables of watercomprehensive treatment of the reservoir's waterqua中国煤化工and, the neural net-Fharacteristics of the' Project (No. 2006AA06Z305) supported by the Hi-Tech ResearchhumYHC N M H Gy, sl-organizationand Development Program (863) of Chinaand error tolerant and has been widely adopted forZhao et al. 1 J Zhejiang Univ SciA 2007 8():1482-14871483mode identification, analysis and forecast, system high-performance visualized numerical computationrecognition and design optimization (Niu et al, 2006; software. Aimed for analysis and design of neuralShu, 2006). MATLAB is mathematical software withnetwork, Toolbox 4.0 offers many toolbox functionshigh-level numerical computation and data visualiza- that can be called directly. GUI and Simulink, the .tion capacity. It provides users with neural network simulation tool, and has become an ideal tool fordesign and simulation and enables them to work on analysis and design of neural network. It provides thedesign and simulation at greater convenience. This GUI for design and simulation of neural network,paper focuses on forecasting the water quality CODmaking it more convenient for the users to design and(chemical oxygen demand) and DO (dissolved oxy- conduct simulation testing. The model can also begen) values of Yuqiao reservoir. Based on BP neuralmodified subject to actual needs to forecast waternetwork technique and MATLAB's GUI function, the quality under various conditions.study creates a water quality forecast model andadopts the 2005 measured values of Yuqiao reservoir Basic theory of creating the modelas sample data to conduct testing and simulation inIn recent years, neural network technology hasorder to verify the viability of the model.been widely adopted in water quality forecast, inwhich BP network is commonly used (Lee et al, 2003;Mo et al,, 2004). The model created in this paper is aIDENTIFICATION OF STUDY OBJECTS ANDBP neural network model with a single hidden layerAFFECTING FACTORS(Fig.1), with R as the input layer, s' the hidden layer,S the output layer, Iw the weight matrix of theCOD and DO are two major values for evaluat-input layer, LW. the weight matrix from the hiddening water quality This paper studies the forecast of layer to the output layer, b' and b2 threshold values ofCOD and DO at Yuqiao reservoir. Based on existingthe hidden and output layer respectively andf' andfmeasured values and correlative analysis, 8 factorsthe neuron transfer functions of the hidden and outputare identified as affecting factors including waterlayer respectively. As theoretically proven, such BPtemperature, turbidity, pH, alkalinity, chloride,model as shown in Fig.1 can approach any nonlinearNH4*-N, NO2 -N and hardness, each of which affectsfunction with limited interruptions at any accuracy asthe water quality COD and DO to a certain degree. In long as the neurons in the hidden layer of the modeladdition, today's COD and DO value will have someare sufficient (Xu and Wu, 2002).impact on that of the next day, so in the end 10 factorsare determined to be affecting factors for the forecast,S'xRi.e., the input variables of the model, and COD andDO, being the study objects, are output variables. Theymodel intends to achieve a forecast of the next day'sjDsxiCOD and DO value from today's 10 water qualityvariables, or affecting factors.SxISRCREATING THE WATER QUALITY FORECASTFig.1 BP neural network with a single hidden layerMODELIn Fig. 1, the input and output variables are es-MATLABtablished for evaluation of water quality. The inputCreating and testing the model is done viavariables are the factors affecting the output variables,MATLAB, a mathematical software introduced bywhich are also the study objects. It is assumed that theMathworks of USA in 1982 which has high-levelactual中国煤化工-utput layer isy()numerical computation and data visualization capac-at timeE1), so the networkity (Zhang, 1999). MATLAB Neural Network Tool-rror fYHCNMHGillbedefinedasbox 4.0 is an integral part of MATLAB6.xfollows:1484Zhao et al.1JZhejiang Univ SciA 2007 8(9): 1482-1487E(0)=之家(,()-d0),First, upload respectively under Inputs and Tar-gets in GUI main page the input and output (arget)data that have been previously witten into Excelq is the number of neurons in the output layer (S);eisworksheet. The input variables are set at 10 and out-a pre-set error margin. The model that stops testing put variables 2. Next, click New Network to create awhen E() is less than ε is the desired model (Guoet new network model as shown in Fig.3. Selectal, 2001; Kuo et al., 2004).Feed-forward backdrop as the Network Type. BasedAny input and output water quality variables thaton experiences, the number of neurons in the hiddenare correlated with each other can find a suitable layer (i.e. Layer 1) can be chosen between 10 and 20,network model to connect the input and output endsand LOGSIG or TANSIG as the neuron transfer func-by adjusting the internal structure of the network and tion of the hidden layer. The output charateristics ofvariables of the model. In the model, the number ofthe entire neural network will be decided by the .neurons in the hidden layer, the transfer function ofcharacteristics of the last layer of the BP network.neurons in the hidden and output layers can beWhen Sigmoid functions are applied to the last layer,changed and the appropriate learning algorithm canthe output of the entire network will be limited to abe selected to meet the pre-determined standards onsmaller range; and if Purelin is applied to the lasterror rate. .layer, the output could be an arbitrary value. As aAny type of model always relies on the use of result, Purelin is chosen as the transfer function forsample data to train the network so as to find the bestthe neurons of the output layer.working model (Xu et al, 2007). Taking the existingwater quality measured values as the input and output人Create New MetworkNetwork Name-netronktsample data, the model will be tested and put to asimulation testing. If the error rate is within an ac-Netvork Type: Feed-orward backpropceptable range, the model can then be applied forInput range:369.34752 Joet tor impTraining functon:water quality forecast in real life (Chang and Chao,Adaption te arming functonLEARNODM2006).Performance funcion: MsNumber of layers:Propertes for: Layer1Creating water quality forecast model with| Number or neurons:10MATLABTransfer Functione TANSIOBy keying in nntool in the command window ofMATLAB, the user will enter the main page of theVew D0 DefautsC CancelC Creatoneural network GUI (Fig.2), the Network/DataManager.Fig.3 Create new networkNetwork/Data ansE arWhile traditional BP algorithm is a gradient de-nputsNetwrorksOutpuls:scent algorithm, which computes rather slowly due tolinear convergence, LM (Levenberg-Marquardt) al-Targets:Errorsgorithm, improved from BP algorithm, is much fastersince it adopts the method of approximate secondnput Dolay States:Loyer Deliy stotederivative (Wang, 2004). Therefore, LM algorithmisused in the model, i.e., select TRAINLM for theTraining Function in the figure above.The input and output data come from the 3HelrNew Data.) Niew Notwork ]months, a total of 90 days' measured values of 2005 atCimpot.JC Expon.C Vwew J0 DeleteYuqian resernir, Tianin therefore there are 90Eintalze 司imulateAdantgrou中国煤化工;ince-ince the number ofneuMHCNMHGselectedamongI1Fig.2 GUI main pageoptions between 11 and 20 and the transfer functionsZhao et al. 1J Zhejiang Univ SciA 2007 8(9);1482-14871485from either TANSIG or LOGSIG, 22 models can be2000 trainings and the errors of the 22 models aretotally created subject to various numbers of neurons compared, the model with the lowest error rate will beand transfer functions in the hidden layer. Fig.4 showsthe desired model. Table 1 shows the error rate ofone example of the model. Each model will be trainedeach model at each test.and tested with sample data separately.The table shows that the lowest error rate is .0.0002190. Therefore, the corresponding network小Hetwork: network1will be the desired forecast model, of which theVew[ Intaice Simulate TrainL AdaptL Weightsnumber of neurons in the hidden layer is 18 andtransfer function TANSIG. The error rate of the modelis rather small. Then simulation testing will be done tovalidate the forecast results of the model.[0田。丹Manager CloseSIMULATION TESTINGFig.4 Network structure 1Once the best working model is obtainedthrough network training, the COD and DO forecastvalues of November will be worked out and comparedRESULT ANALYSIS AND MODEL SELECTIONwith actual measured values to evaluate the forecastresults.Each model gets tested three times. Since initialFigs.5 and 6 show the simulation results ofCOD.weights and thresholds are randomly generated,Fig.5 compares the COD forecast values with thetraining results will turn out to be different every time.actual measured values, and Fig.6 shows the CODSelect the lowest error rate as the minimum value thatforecast error rate. It can be seen in Fig.5 that the twothe model can achieve. When each model completescurves almost overlap each other. Correlative analysisTable 1 Comparison of the error rate of each model at each testTransfer functionNumber of neuronsTest1Test 2Test 3Optimal valueof the hidden layer in the hidden layer100.02330990.04493210.0400328110.03154910.01512270.00272080.03674090.0129202130.03827160.13750700.0089725140.24519300.00262400.0482054TANSIG150.04976640.00357870.0054661160.00170940.00238780.0079453170.00565530.00143240.0111583180.00021900.03067620.00063350.0002 190*0.00150050.00125830.0015936200.00122520.01711380.05698070.01687890.02275900.06861200.01234240.10125600.0362708120.08055040.00487810.03385890.03881260.03896660.01328470.01237010.01492340.0110111LOGSIG .0.01179380.06185090.03045950.00124920.04728390.00217350.0146762中国煤化工0.0181797190.00133491HCNMHG00133490.04602490.01 22980U.UU883020.0088362“0.0002190 is the lowest error rate1486Zhao et al. / J Zhejiang Univ SciA 2007 8(9):1482-1487From Figs.5 and 7, it can be seen that the fore-4.0t巨3.8cast results of the first half of November are better3.6than that of the second half. Since the sample data is".M/Wselected from August through October of 2005, it3.0Lindicates that the forecast model is relativelytime-bound. As time goes by, the more deviated is theNumberforecast result. Therefore it is quite necessary to up-Fig.5 COD forecast value and actual measured valuedate the model from time to time with new measuredvalues. And the fact that the DO forecast result comesout better than that of COD shows that the selectedaffecting factors have greater impact on COD than onDO and that selection of affecting factors might affectr 30the forecast results of the model remarkably. Severalforecast values in the figures are more deviated fromactual measured values due to the fact that forecastvalues can be affected by many factors during theFig.6 COD forecast error ratestudy. In addition to the identified affecting factors,between the two groups of data indicates that themany other factors, such as weather condition OICOD correlative coefficient is 0.8537, and analysis ofenvironmental pollution, can affect the forecast val-the forecast error rate shows that the average forecastues every moment. They can be so unpredictable anderror is 2.56%, with maximum at 6.70% and mini-thus make the study work more difficult. Nevertheless,mum at 0.36%.the average forecast error rate indicates that theFigs.7 and 8 show the simulation results of DO.overall forecast results are fairly good with error rateFig.7 compares the DO forecast values with the actualcontrolled within an acceptable range, proving themeasured values, and Fig.8 shows the DO forecastviability of the forecast model.error rate. Correlative analysis between two groups ofdata indicates that the DO correlative coefficient is0.9418, and analysis of the forecast error rate showsCONCLUSIONthat the average forecast error is 1 .68%, with maxi-mum at 4.72% and minimum at 0.26%.This paper adopts the BP neural networktechnology and GUI function of MATLAB to achieveG 9.2 t士Actual measured valueeasier and faster water quality forecast at Yuqiao, 8.7-Forecasting valuereservoir. A water quality forecast model is created当82with application of neural network, in which LM8 7.7.7 j=t#*dalgorithm is used for its faster convergence speed andlower error rate to overcome the shortcomings oftraditional BP algorithm as slow to converge and easyFig.7 DO forecast value and actual measured valueto reach extreme minimum value. The study has the2005 actual measured values of the reservoir as sam-ple data to train the model. By changing the numberof neurons and the type of transfer function of thehidden layer, the best working forecast model wasprr↑obtained. Simulation testing showed that forecastmodel is time-bound and therefore it is necessary to15 3updatime with actualmeas中国煤化工fecting factors alsoplays:YHC N M H Give great impact onFig.8 DO forecast error ratehe forecast results. It concludes that the model canZhao et al. 1J Zhejang Univ SciA 2007 8(9):1482-14871487produce good forecast results in general and can bedisease in Taiwan. Water Research, 38(1):148- 158.doi: 10.1016/j. watres.2003.09.026]used for water quality forecast of the reservoir.Moreover, this model can be extended to furtherKurunc, A., Yirekli, K., Cevik, O., 2005. Performance of twostochastic approaches for forecasting water quality andapplications. Provided that other water quality vari-streamflow data from Yesilurmak River, Turkey. Envi-ables of this reservoir are to be forecasted, or a varietyronmental Moelling & Sofware, 20(9):1195-1200.of variables to be forecasted simultaneously, it only[doi:10. 1016/j. envsoft.2004.11.001]needs to identify the affecting factors first, then createLee, J.H.W., Huang, Y, Dickman, M., Jayawardena, A.W,2003. Neural network modeling of coastal algal blooms.the forecast model in the way mentioned above, de-Ecological Meling, 159(2-3):179-201. (doi:10.1016/cide the input and output variables for the model, useS0304-3800(02)00281-8]existing measured values as sample data for training,Li, R.Z.. 2006. Advance and trend analysis of theoreticalobtain the best working model by changing the net-methodology for water quality forecast. Journal of HefeiUniversity of Technology, 29(1):26-30.work's internal structure and variables, and completethe model with simulation testing. If the correlationMo, HF, Gu, A.Y, Zhang, X.z., Zhang, J.C., 2004. Researchon a method of BP neural network in water qualitybetween the forecast and actual measured values isevaluation. Control Engineering of China, 11:9-10,19.fairly good, the forecast model is viable and can beNiu, Z.G, Zhang, H.W., Liu, H.B., 2006. Application of neuralapplied to real practice. In this sense the forecastnetwork to prediction of coastal water quality. Journal ofmodel is characterized by its extendability and prac-Tianjin Polytechnic Universit, 25(2):89-92.tibility. Nevertheless, due to the fact that water qualityShu, J.. 2006. Using neutral network model to predict waterquality. North Envronmenl, 31(1):44-46.forecast can be easily affected by external environ-Vandenberghe, V, Bauwens, w., Vantolleghem, PA., 2007.ment (Vandenberghe et al, 2007), the obtained modelEvaluation of uncertainty propagation into river watersometimes produces results much deviated from thequality predictions to guide future monitoring campaigns.actual values, therefore further study needs to be doneEnvironmental Modelling & Sofware, 22(5):725-732.in future work to identify the suitable forecast model,[doi:10. 1016/j.envsoft.2005.12.019]understand its laws of changes and solve the problemWang, Q.H, 2004. Improvement on BP algorithm in artificialneural network. Journal of Qinghai University, 22(3):of forecast deviation.82-84.Wu, HJ, Lin, Z.Y, Guo, S.L., 2000. The application of arti-Referencesficial neural networks in the resources and environment.Chang, T.C, Chao, R.J, 2006. Application of backpropagationResources and Environment in the Yangtze Basin,networks in debris flow prediction. Engineering Geology,9(2):237-241 (in Chinese).85(3-4):270-280. (do: 10.1016/j. enggeo.2006.02 007]Xiang, S.L, Liu, Z.M., Ma, L.P., 2006. Study of mutivariateChen, L.H., Chang, Q.C, Chen, X.G, Hu, Z.D., 2003. Usinglinear regression analysis model for ground water qualityBP neural network to predict the water quality of Yellowprediction. Guizhou Science, 24(1):60-62.River. Journal of Lanzhou University (Natural Sciences),Ku, D, Wu, Z., 2002. Neural Network-system Design and39(2):53-56 (in Chinese).Analysis Based on MATLAB6.X. University of XianGuo, Z.Y, Chen, Z.Y, Li, L.Q., Song, B.P, Lu, Y, 2001.Electronics Technology Press, Xi' an, p.2 (in Chinese).Artificial neural network and its application in regimeXu, LJ, Xing, J.D.,. Wei, S.Z., Zhang, Y.Z., Long, R.. 2007.prediction of groundwater quality. Journal of East ChinaOptimization of heat treatment technique of high-vana-Normal University (Natural Sciences), (1):84-89 (in Chi-dium high-speed steel based on back propagation neuralnese).networks. Materials & Design, 28(5):1425-1432. [doi:10.Kuo, Y.M, Liu, C.W, Lin, K.H., 2004. Evaluation of the1016/j.matdes. 2006. 03.022]ability of an artificial neural network model to assess theZhang, Y.H., 1999. Mastering MATLABS. Tsinghua Univer-variation of groundwater quality in an area of blackfootsity Press, Bejing, p.1-2 (in Chinese).中国煤化工MYHCNMHG

论文截图
版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。