毛湘云 徐冰峰 孟繁藝



摘 要:針對余氯量在供水系統內非線性變化特性,建立了PSO-SVM+BP神經網絡組合模型對管網末端余氯進行預測分析。該模型通過粒子群優化算法(PSO),對SVM的特性參數進行優化;采用BP神經網絡對模型進行殘差修正。本文通過對比BP和SVM單一預測、對組合模型預測精度進行分析。結果表明:組合模型預測比BP和SVM單一預測均方誤差分別降低了62.30%、75.29%,平均相對誤差降低了55.03%、54.27%。綜上所述,該模型具有強大的非線性擬合能力,預測精度高,運行穩定性強,對供水企業控制余氯的投加量和設置二次加氯點有一定的指導性作用。
關鍵詞:余氯;支持向量機;粒子群算法;神經網絡;組合模型
中圖分類號:TU991.33? ?文獻標識碼: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.引言
氯是供水處理中使用最廣泛的一種消毒劑,余氯作為衡量管網水質的一項重要指標,對控制水中的細菌滋生,保證管網水質安全十分重要。《生活飲用水衛生標準》(GB 5749—2006)中規定,出廠水余氯應大于0.3mg/L,管網末梢余氯量不應小于0.05mg/L[1]。但由于氯是一種非穩定性物質,受到管網中各種因素的影響,其濃度隨時間的推移而發生削減,消毒能力下降,使得水質發生惡化,水質保障的中心已逐漸由水廠向管網轉移[2-4]。所以探究余氯預測方法,為供水企業對氯的投加提供參考十分重要[5]。
由于余氯濃度在管網中的削減是非線性變化,且管網內影響余氯的因素眾多,若采用機理性模型進行預測,其準確性差,建立難度大,求解困難[6-7]。目前已有研究多采用單一網絡或復合網絡對余氯進行預測,加之分析樣本有限,預測后沒有對結果進行誤差修正,且隨著樣本量的增加預測精度也隨之下降,網絡的精確性、收斂性及穩定性不好,難以獲得理想的預測結果[5,,8-9]。本文通過PSO-SVM+BP神經網絡余氯預測模型,建立多個影響因素與管網末端余氯映射關系,以了解余氯的衰減規律,實現對余氯濃度的動態預測。
1 PSO-SVM+BP神經網絡組合模型
支持向量機(Support Vector Machine)是基于統計學理論發展起來的機器學習算法[5]。它以結構風險最小化原則為理論基礎,引入核函數方法,將原始問題映射到高維空間,把待求解問題轉換為二次優化問題,使SVM收斂于問題的全局最優解。它適能較好地解決小樣本、非線性、高維數和局部極小點等實際問題,具有良好的泛化能力[10-12]。但SVM中關鍵參數(核函數參數、懲罰因子C)的選取多依靠經驗或實驗,而這些參數對預測的結果有至關重要的影響[13]。
所以,針對SVM參數選取的盲目性,采用粒子群算法(PSO)對SVM進行參數優化,以SVM輸出的均方誤差為適應度函數,粒子通過跟蹤個體極值和全局極值在空間內不斷更新自己的位置信息、遷移方向和速度值,以尋找出空間內的最優解,即輸出SVM最小均方誤差時帶入的參數粒子[14],消除SVM參數選取的盲目性,但PSO算法后期收斂到一定的程度時就無法繼續優化,所以精度不高。所以為提高精度利用BP神經網路較高的可靠性和良好的容錯性,獲得輸入變量與優化模型預測誤差之間的映射關系,建立BP神經網絡殘差修正模型[15-17]。最終通過兩個模型的組合進行優勢互補,深度挖掘數據信息,以獲得更理想的預測結果,提高預測精度。
2 組合算法模型的建立
3結論
本文通過PSO算法優化SVM模型參數,并使用BP神經網絡對模型結果進行殘差修正,建立了PSO-SVM+BP神經網絡余氯預測模型,找到多個因素與管網末端余氯的關系,通過不同模型產生的誤差進行模型性能的對比分析。發現該模型可以實現對管網末端余氯量的預測,有效的簡化了余氯在管網中衰減變化的復雜非線性關系,克服了SVM模型參數選擇的盲目性,利用BP網絡對結果進行優化,進一步提升了預測的精度和模型運行的穩健性。結果表明該模型具有良好的預測性能,能夠使供水企業更早的發現水質惡化的趨勢,及時采取相關措施,在控制末端水水質的前提下,降低消毒副產物的產生,并為二次消毒點的選取提供參考。
參考文獻:
[1] 衛生部. 生活飲用水衛生標準[J]. 經濟管理文摘, 2006(11):36-38.Ministry of Health. Standards for drinking water quality[J].Economic management digest, 2006(11):36-38.
[2] 周廣宇, 莫罹, 趙新華, 等. 基于多組分水質模型的供水管網細菌風險研究[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)[知網]
[3] 楊航, 李敏, 俞國平. 基于人工神經網絡的市政管網水質模型研究[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] 戴舒, 郭姣. 南方某市供水管網水質模型的建立與校核[J]. 供水技術, 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] 劉國紅, 廖玉學, 黃廣文, 等. 深圳市2016年生活飲用水水質影響因素[J]. 中國熱帶醫學, 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]. 傳感器與微系統, 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模型的管網余氯預測研究[J]. 中國農村水利水電, 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 模型的供水系統余氯預測研究[J]. 長江科學院院報, 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] 謝芳, 唐德善. 農業灌溉用水量的LS-SVM預測模型研究[J]. 安徽農業科學, 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]. 山東交通學院學報, 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神經網絡原理與實例精解[M]. 北京: 清華大學出版社, 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] 鐘丹, 袁一星, 馬文成, 等. 供水管網內生物膜與余氯衰減交互作用[J]. 哈爾濱工業大學學報, 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] 郝艷萍. 余氯衰減一級模型參數確定方法試驗研究[D]. 哈爾濱: 哈爾濱工業大學, 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] 黃銳, 李翠梅, 羅賢達,等. 影響供水管網中余氯與濁度的因素及相關性分析[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的城市供水管網余氯預測分析[J]. 重慶建筑大學學報, 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)
(編輯:胡玲)