毛湘云 徐冰峰 孟繁藝
摘 要:針對余氯量在供水系統(tǒng)內(nèi)非線性變化特性,建立了PSO-SVM+BP神經(jīng)網(wǎng)絡(luò)組合模型對管網(wǎng)末端余氯進行預(yù)測分析。該模型通過粒子群優(yōu)化算法(PSO),對SVM的特性參數(shù)進行優(yōu)化;采用BP神經(jīng)網(wǎng)絡(luò)對模型進行殘差修正。本文通過對比BP和SVM單一預(yù)測、對組合模型預(yù)測精度進行分析。結(jié)果表明:組合模型預(yù)測比BP和SVM單一預(yù)測均方誤差分別降低了62.30%、75.29%,平均相對誤差降低了55.03%、54.27%。綜上所述,該模型具有強大的非線性擬合能力,預(yù)測精度高,運行穩(wěn)定性強,對供水企業(yè)控制余氯的投加量和設(shè)置二次加氯點有一定的指導(dǎo)性作用。
關(guān)鍵詞:余氯;支持向量機;粒子群算法;神經(jīng)網(wǎng)絡(luò);組合模型
中圖分類號:TU991.33? ?文獻標(biāo)識碼:A? ?文章編號:
Abstract: Due to the nonlinearity of residual chlorine in the pipe network, we established a PSO-SVM and BP neural network combined model to prediction of residual chlorine.This model through particle swarm optimization algorithm (PSO) to optimization the characteristics parameter of the SVM, and use the BP neural network model to residual error correction. In this paper , we analyzed the prediction precision of combined model by comparing the single prediction model of BP and SVM. The results show that compared with the single prediction of BP and SVM, the mean square error of the combined model decreased by 62.30% and 75.29% respectively, but the average relative error decreased by 55.03% and 54.27% respectively. In a conclusion, the combined model had strong nonlinear fitting capability, high prediction accuracy, and strong operation stability. This model plays an important role in controlling the residual chlorine dosing and setting the secondary chlorination point for water supply enterprise
Keywords: residual chlorine; Support vector machines; Particle swarm optimization; neural networks; combined model;
0.引言
氯是供水處理中使用最廣泛的一種消毒劑,余氯作為衡量管網(wǎng)水質(zhì)的一項重要指標(biāo),對控制水中的細菌滋生,保證管網(wǎng)水質(zhì)安全十分重要?!渡铒嬘盟l(wèi)生標(biāo)準(zhǔn)》(GB 5749—2006)中規(guī)定,出廠水余氯應(yīng)大于0.3mg/L,管網(wǎng)末梢余氯量不應(yīng)小于0.05mg/L[1]。但由于氯是一種非穩(wěn)定性物質(zhì),受到管網(wǎng)中各種因素的影響,其濃度隨時間的推移而發(fā)生削減,消毒能力下降,使得水質(zhì)發(fā)生惡化,水質(zhì)保障的中心已逐漸由水廠向管網(wǎng)轉(zhuǎn)移[2-4]。所以探究余氯預(yù)測方法,為供水企業(yè)對氯的投加提供參考十分重要[5]。
由于余氯濃度在管網(wǎng)中的削減是非線性變化,且管網(wǎng)內(nèi)影響余氯的因素眾多,若采用機理性模型進行預(yù)測,其準(zhǔn)確性差,建立難度大,求解困難[6-7]。目前已有研究多采用單一網(wǎng)絡(luò)或復(fù)合網(wǎng)絡(luò)對余氯進行預(yù)測,加之分析樣本有限,預(yù)測后沒有對結(jié)果進行誤差修正,且隨著樣本量的增加預(yù)測精度也隨之下降,網(wǎng)絡(luò)的精確性、收斂性及穩(wěn)定性不好,難以獲得理想的預(yù)測結(jié)果[5,,8-9]。本文通過PSO-SVM+BP神經(jīng)網(wǎng)絡(luò)余氯預(yù)測模型,建立多個影響因素與管網(wǎng)末端余氯映射關(guān)系,以了解余氯的衰減規(guī)律,實現(xiàn)對余氯濃度的動態(tài)預(yù)測。
1 PSO-SVM+BP神經(jīng)網(wǎng)絡(luò)組合模型
支持向量機(Support Vector Machine)是基于統(tǒng)計學(xué)理論發(fā)展起來的機器學(xué)習(xí)算法[5]。它以結(jié)構(gòu)風(fēng)險最小化原則為理論基礎(chǔ),引入核函數(shù)方法,將原始問題映射到高維空間,把待求解問題轉(zhuǎn)換為二次優(yōu)化問題,使SVM收斂于問題的全局最優(yōu)解。它適能較好地解決小樣本、非線性、高維數(shù)和局部極小點等實際問題,具有良好的泛化能力[10-12]。但SVM中關(guān)鍵參數(shù)(核函數(shù)參數(shù)、懲罰因子C)的選取多依靠經(jīng)驗或?qū)嶒?,而這些參數(shù)對預(yù)測的結(jié)果有至關(guān)重要的影響[13]。
所以,針對SVM參數(shù)選取的盲目性,采用粒子群算法(PSO)對SVM進行參數(shù)優(yōu)化,以SVM輸出的均方誤差為適應(yīng)度函數(shù),粒子通過跟蹤個體極值和全局極值在空間內(nèi)不斷更新自己的位置信息、遷移方向和速度值,以尋找出空間內(nèi)的最優(yōu)解,即輸出SVM最小均方誤差時帶入的參數(shù)粒子[14],消除SVM參數(shù)選取的盲目性,但PSO算法后期收斂到一定的程度時就無法繼續(xù)優(yōu)化,所以精度不高。所以為提高精度利用BP神經(jīng)網(wǎng)路較高的可靠性和良好的容錯性,獲得輸入變量與優(yōu)化模型預(yù)測誤差之間的映射關(guān)系,建立BP神經(jīng)網(wǎng)絡(luò)殘差修正模型[15-17]。最終通過兩個模型的組合進行優(yōu)勢互補,深度挖掘數(shù)據(jù)信息,以獲得更理想的預(yù)測結(jié)果,提高預(yù)測精度。
2 組合算法模型的建立
3結(jié)論
本文通過PSO算法優(yōu)化SVM模型參數(shù),并使用BP神經(jīng)網(wǎng)絡(luò)對模型結(jié)果進行殘差修正,建立了PSO-SVM+BP神經(jīng)網(wǎng)絡(luò)余氯預(yù)測模型,找到多個因素與管網(wǎng)末端余氯的關(guān)系,通過不同模型產(chǎn)生的誤差進行模型性能的對比分析。發(fā)現(xiàn)該模型可以實現(xiàn)對管網(wǎng)末端余氯量的預(yù)測,有效的簡化了余氯在管網(wǎng)中衰減變化的復(fù)雜非線性關(guān)系,克服了SVM模型參數(shù)選擇的盲目性,利用BP網(wǎng)絡(luò)對結(jié)果進行優(yōu)化,進一步提升了預(yù)測的精度和模型運行的穩(wěn)健性。結(jié)果表明該模型具有良好的預(yù)測性能,能夠使供水企業(yè)更早的發(fā)現(xiàn)水質(zhì)惡化的趨勢,及時采取相關(guān)措施,在控制末端水水質(zhì)的前提下,降低消毒副產(chǎn)物的產(chǎn)生,并為二次消毒點的選取提供參考。
參考文獻:
[1] 衛(wèi)生部. 生活飲用水衛(wèi)生標(biāo)準(zhǔn)[J]. 經(jīng)濟管理文摘, 2006(11):36-38.Ministry of Health. Standards for drinking water quality[J].Economic management digest, 2006(11):36-38.
[2] 周廣宇, 莫罹, 趙新華, 等. 基于多組分水質(zhì)模型的供水管網(wǎng)細菌風(fēng)險研究[J]. 中國給水排水, 2016, 32(5): 64-69,73.ZHOU G Y, MO L, ZHAO X H, et al. Assessment of bacteria risk in water distribution system based on multispecies water quality model[J]. China Water & Wastewater, 2016, 32(5): 64-69,73.(in Chinese)[知網(wǎng)]
[3] 楊航, 李敏, 俞國平. 基于人工神經(jīng)網(wǎng)絡(luò)的市政管網(wǎng)水質(zhì)模型研究[J]. 給水排水, 2012, 48(S1): 471-475.YANG H, LI M, YU G P. Water quality model of municipal network based on artificial neural network[J]. Water & Wastewater Engineering, 2012, 48(S1): 471-475.(in Chinese
[4] 戴舒, 郭姣. 南方某市供水管網(wǎng)水質(zhì)模型的建立與校核[J]. 供水技術(shù), 2017, 11(4):29-32.DAI S,GUO J.Establishment and calibration of water quality model for water distribution system in a city of South China[J]. Water Technology, 2017, 11(4):29-32.
[5] 劉國紅, 廖玉學(xué), 黃廣文, 等. 深圳市2016年生活飲用水水質(zhì)影響因素[J]. 中國熱帶醫(yī)學(xué), 2018, 18(1): 72-75.LIU G H, LIAO Y X, HUANG G W, et al. Factors influencing drinking water quality in Shenzhen, 2016[J]. China Tropical Medicine, 2018, 18(1): 72-75.(in Chinese)[
[6] 謝昕, 郭鵬飛, 詹小麗, 等. 基于RBF神經(jīng)網(wǎng)絡(luò)的余氯濃度預(yù)測模型研究[J]. 傳感器與微系統(tǒng), 2012, 31(8): 64-65,68.XIE X, GUO P F, ZHAN X L, et al. Research on prediction model of residual chlorine concentration based on RBF neural network[J]. Transducer and Microsystem Technologies, 2012, 31(8): 64-65,68.(in Chinese)
[7] BOWDEN G J, NIXON J B, DANDY G C, et al. Forecasting chlorine residuals in a water distribution system using a general regression neural network[J]. Mathematical and Computer Modelling, 2006, 44(5/6): 469-484.[LinkOut]
[8] 何自立, 王云霏, 馬孝義, 等. 基于改進PSO-WNN模型的管網(wǎng)余氯預(yù)測研究[J]. 中國農(nóng)村水利水電, 2015(2): 86-88,92.HE Z L, WANG Y F, MA X Y, et al. Residual chlorine prediction in water supply system based on improved PSO-WNN model[J]. China Rural Water and Hydropower, 2015(2): 86-88,92.(in Chinese)
[9] 何自立, 郭占娟, 楊建國, 等. 基于 PSO-SVR 模型的供水系統(tǒng)余氯預(yù)測研究[J]. 長江科學(xué)院院報, 2015, 32(10): 6-10.HE Z L, GUO Z J, YANG J G, et al. Residual chlorine prediction in water supply system based on support vector machine regression model optimized by PSO method[J]. Journal of Yangtze River Scientific Research Institute, 2015, 32(10): 6-10.(in Chinese)
[10] 謝芳, 唐德善. 農(nóng)業(yè)灌溉用水量的LS-SVM預(yù)測模型研究[J]. 安徽農(nóng)業(yè)科學(xué), 2010, 38(19): 10273-10275,10288.XIE F, TANG D S. Forecasting irrigation water requirement based on least squares support vector machine[J]. Journal of Anhui Agricultural Sciences, 2010, 38(19): 10273-10275,10288.(in Chinese)
[11] ABHISEK U. Support Vector Machine[J]. Computer Science, 2002, 1(4):1-28.
[12] SUN L F, ZHANG Y Y, SAQI R N. Research on the fouling prediction of heat exchanger based on Support Vector Machine optimized by Particle Swarm Optimization algorithm[C]//2009 International Conference on Mechatronics and Automation, 9-12 Aug. 2009, Changchun, China, 2009: 2002-2007
[13] EBERHART R C, SHI Y H. Comparison between genetic algorithms and particle swarm optimization[M]//EBERHART R C, SHI Y H. eds. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg, 1998: 611-616. DOI:10.1007/bfb0040812[
[14] LIU J, LIU Z, XIONG Y. Method of Parameters Optimization in SVM based on PSO[J]. Transactions on Computer Science & Technology, 2013, 2(1):9-16.
DANG A P, LIU Z F, ZHU Y L, et al .The Detection of Engine Cylinder Wall Clearance Based on BP and Elman
[15] 黨安朋, 劉占峰, 朱延玲, 等. 基于BP與Elman神經(jīng)網(wǎng)絡(luò)的發(fā)動機缸壁間隙檢測[J]. 山東交通學(xué)院學(xué)報, 2015, 23(1): 1-5.DANG A P, LIU Z F, ZHU Y L, et al. The detection of engine cylinder wall clearance based on BP and elman neural network[J]. Journal of Shandong Jiaotong University, 2015, 23(1): 1-5.(in Chinese)
[16] 陳明, ◆◆◆. MATLAB神經(jīng)網(wǎng)絡(luò)原理與實例精解[M]. 北京: 清華大學(xué)出版社, 2013
[17] WANG J J, SHI P, JIANG P, et al. Application of BP neural network algorithm in traditional hydrological model for flood forecasting[J]. Water, 2017, 9(1): 48
[18] LI C, YU J, ZHANG T, et al. The effect of factors on chlorine decay and trihalomethane formation in a pilot-scale distribution system[J]. Fresenius Environmental Bulletin, 2014, 23(1):223-227.
[19] POWELL J C, HALLAM N B, West J R, et al. Factors which control bulk chlorine decay rates[J]. Water Research, 2000, 34(1):117-126.
[20] 鐘丹, 袁一星, 馬文成, 等. 供水管網(wǎng)內(nèi)生物膜與余氯衰減交互作用[J]. 哈爾濱工業(yè)大學(xué)學(xué)報, 2017, 49(8): 49-54.ZHONG D, YUAN Y X, MA W C, et al. Interaction effects between biofilm and chlorine decay in water distribution network[J]. Journal of Harbin Institute of Technology, 2017, 49(8): 49-54.(in Chinese)
[21] 郝艷萍. 余氯衰減一級模型參數(shù)確定方法試驗研究[D]. 哈爾濱: 哈爾濱工業(yè)大學(xué), 2016.HAO Y P. Study on method of the first order chlorine decay model parameters determination[D]. Harbin: Harbin Institute of Technology, 2016.(in Chinese)
[22] 黃銳, 李翠梅, 羅賢達,等. 影響供水管網(wǎng)中余氯與濁度的因素及相關(guān)性分析[J]. 給水排水, 2015,51(5):147-151.HUANG R, LI C M, LUO X D, et al . Factors and correlation analysis of residual chlorine and turbidity in water supply pipe network [J].Water & Wastewater Engineering, 2015,51(5):147-151.
[23] 田一梅, 吳迷芳, 王陽, 等. 基于SVR的城市供水管網(wǎng)余氯預(yù)測分析[J]. 重慶建筑大學(xué)學(xué)報, 2006, 28(2): 74-78.TIAN Y M, WU M F, WANG Y, et al. Prediction and analyses of residual chlorine based on support vector regression in urban water distribution system[J]. Journal of Chongqing Jianzhu University, 2006, 28(2): 74-78.(in Chinese)
(編輯:胡玲)