﻿ 基于改进萤火虫寻优支持向量机的PM2.5预测
 计算机系统应用  2019, Vol. 28 Issue (1): 134-139 PDF

PM2.5 Forecasting Based on Improved Firefly Optimization SVM
FAN Wen-Ting, WANG Xiao
School of Computer Science and Technology, Taiyuan University of Science and Technology, Taiyuan 030024, China
Foundation item: Doctorate Fund of Taiyuan University of Science and Technology (20152044)
Abstract: Aiming at the problem of large deviation in existing PM2.5 concentration prediction, a novel model based on Improved Firefly Algorithm optimization SVM (IFA-SVM) was proposed. In this model, two neighborhood search strategies and variable step size mechanism were employed to improve FA. The IFA was applied to optimize the SVM parameters (C, , and ), and an outstanding model was constructed to forecast PM2.5 concentrations in Taiyuan. The neighborhood search strategies can provide better candidate solutions; search step size was dynamically tuned by using variable step size strategy to accelerate convergence and obtain a trade-off between exploration and exploitation. The performance of the proposed IFA-SVM model has been compared with FA-SVM, Genetic Algorithm (GA)-SVM, and Particle Swarm Optimization (PSO)-SVM. Experimental results show that the proposed IFA-SVM model has achieved more accurate performance for PM2.5 forecasts in 1 day ahead and 3 days ahead compared to other method.
Key words: Firefly Algorithm (FA)     Support Vector Machine (SVM)     neighborhood search strategies     variable step size     parameter optimization     PM2.5 forecasting

1 PM2.5预测原理

PM2.5预测是依据气象条件、污染源等因素和历史数据建立数学模型来预测未来PM2.5值, 表示为如下非线性关系:

 $y = f\left( {{x_1}, {x_2}, \cdots, {x_n}} \right)$ (1)

2 算法理论基础 2.1 SVM基本原理

SVM基本思想是针对PM2.5非线性样本, 引入径向基(Radial Basis Function, RBF)核函数, 将样本映射到高维空间, 在高维空间求解超平面, 使得两类样本的间隔最大[21], 即求解如下约束优化问题:

 $\mathop {\min }\limits_{w, b, \xi } \frac{1}{2}{w^{\rm T}}w + C\sum\limits_{i = 1}^i {{\varepsilon _i}}$ (2)

 $K({x_i}, {x_j}) = \exp ( - \gamma {\left| {{x_i} - {x_j}} \right|^2})$ (3)

2.2 标准FA基本原理

FA受自然界萤火虫生物特性启发[22], 其对SVM参数优化思想为:

 $I = {I_0} \times {e^{ - \gamma {r_{ij}}}}$ (4)
 $\beta = {\beta _0} \times {e^{ - \gamma {r_{ij}}}}^{^2}$ (5)

 ${x_i} = {x_i} + \beta \times ({x_j} - {x_i}) + \alpha \times \left({{rand}} - \frac{1}{2}\right)$ (6)

FA主要步骤包括:

(1)根据目标函数计算萤火虫的亮度;

(2)亮度较暗的萤火虫按公式(6)向较亮的萤火虫移动;

(3)对萤火虫按亮度值从大到小排序, 找到最亮的萤火虫;

(4)重复迭代, 直到达到最大迭代次数.

2.3 基于邻域搜索策略的改进FA

 ${x_i}^1 = {\lambda _1} \times {x_i} + {\lambda _2} \times pbest + {\lambda _3} \times ({x_{i1}} - {x_{i2}})$ (7)

 ${x_i}^2 = {\lambda _4} \times {x_i} + {\lambda _5} \times gbest + {\lambda _6} \times ({x_{i3}} - {x_{i4}})$ (8)

2.4 基于可变步长的改进FA

 $\alpha = 0.4/(1 + \exp (0.015 \times (t - maxG)/3))$ (9)

3 萤火虫寻优支持向量机(FA-SVM)PM2.5预测模型 3.1 IFA-SVM PM2.5预测原理

IFA-SVM PM2.5预测过程如下:

(1)收集太原市PM2.5浓度实验数据, 划分训练集和测试集, 并归一化预处理;

(2) IFA-SVM参数迭代寻优

1)初始化算法各基本参数, 随机分布萤火虫;

2)计算萤火虫的目标函数值, 以SVM对训练集的PM2.5预测性能作为目标函数值;

3)对萤火虫的目标函数值进行亮度排序, 找到当前最优的目标函数值及其对应萤火虫, 并根据公式(6)更新萤火虫;

4)如果迭代过程中, 第t次迭代目标函数值与t–1迭代目标函数值相等, 执行2.3节中两种邻域搜索策略;

5)若达到最大迭代次数, 或满足停止迭代的条件, 则转至步骤6), 否则转至步骤2)继续迭代;

6)输出最大目标函数值及其对应的萤火虫, 即得到最优参数.

(3)使用最优参数预测测试集PM2.5值, 并将预测结果反归一化, 得到实际PM2.5预测值, 输出结果.

 图 1 IFA-SVM PM2.5预测流程

3.2 数据收集及预处理

 $x_i' = \left( {{x_i} - {x_{\min }}} \right)/\left( {{x_{\max }} - {x_{\min }}} \right)$ (10)

3.3 评价标准

 $MAE = \frac{1}{N}\sum\limits_{i = 1}^N {\left| {{O_i} - {P_i}} \right|}$ (11)
 $RMSE = \sqrt {\frac{1}{N}{{\sum\limits_{i = 1}^N {\left( {{O_i} - {P_i}} \right)} }^2}}$ (12)

3.4 参数优化

 图 2 算法对Ackley函数的收敛曲线对比

 图 3 算法对Sphere函数的收敛曲线对比

3.5 实验结果与分析 3.5.1 IFA-SVM实验结果与分析

(1)预测未来一天PM2.5浓度值;

(2)预测未来第三天PM2.5浓度值.

 图 4 IFA-SVM PM2.5预测结果对比图

3.5.2 实验结果比较与分析

4 结论与展望

(1) IFA-SVM模型对未来一天和三天的PM2.5值都可以有效预测, 由于预测误差会不断积累, 一天的预测精度更高.

(2) FA能够跳出局部最优且计算简单, FA-SVM模型比GA-SVM和PSO-SVM方法预测更准确.

(3)引入邻域搜索和可变步长策略改进FA, 可加速算法收敛, 平衡局部和全局性能, 使得IFA-SVM模型预测结果更接近实际的PM2.5变化趋势, 为雾霾预测提供了一种新思路.

 [1] 孙志豪, 崔燕平. PM2.5对人体健康影响研究概述 . 环境科技, 2013, 26(4): 76-78. [2] 周艳军. PM2.5的污染危害及预防对策 . 产业与科技论坛, 2013, 12(11): 114-115. DOI:10.3969/j.issn.1673-5641.2013.11.064 [3] Jian L, Zhao Y, Zhu YP, et al. An application of ARIMA model to predict submicron particle concentrations from meteorological factors at a busy roadside in Hangzhou, China. Science of the Total Environment, 2012, 426: 336-345. DOI:10.1016/j.scitotenv.2012.03.025 [4] 郎艺超, 肖璐, Christakos G. 基于SARIMA模型和普通Kriging法对杭州市主城区PM2.5短期预测和制图 . 环境科学学报, 2018, 38(1): 62-70. [5] 程兴宏, 刁志刚, 胡江凯, 等. 基于CMAQ模式和自适应偏最小二乘回归法的中国地区PM2.5浓度动力-统计预报方法研究 . 环境科学学报, 2016, 36(8): 2771-2782. [6] Pérez P, Trier A, Reyes J. Prediction of PM2.5 concentrations several hours in advance using neural networks in Santiago, Chile . Atmosphere Environment, 2000, 34(8): 1189-1196. DOI:10.1016/S1352-2310(99)00316-7 [7] Feng X, Li Q, Zhu YJ, et al. Artificial neural networks forecasting of PM2.5 pollution using air mass trajectory based geographic model and wavelet transformation . Atmospheric Environment, 2015, 107: 118-128. DOI:10.1016/j.atmosenv.2015.02.030 [8] 艾洪福, 石莹. 基于BP人工神经网络的雾霾天气预测研究. 计算机仿真, 2015, 32(1): 402-405, 415. DOI:10.3969/j.issn.1006-9348.2015.01.085 [9] 陈俏, 曹根牛, 陈柳. 支持向量机应用于大气污染物浓度预测. 计算机技术与发展, 2010, 20(1): 250-252. DOI:10.3969/j.issn.1673-629X.2010.01.065 [10] Wu ZH. SVR smoggy forecast model based on data mining. International Journal of Science, 2015, 2(9): 120-125. [11] 朱霄珣, 徐搏超, 焦宏超, 等. 遗传算法对SVR风速预测模型的多参数优化. 电机与控制学报, 2017, 21(2): 70-75. [12] 戴李杰, 张长江, 马雷鸣. 基于机器学习的PM2.5短期浓度动态预报模型 . 计算机应用, 2017, 37(11): 3057-3063. [13] 杨孟英. 基于支持向量机的中文文本分类研究[硕士学位论文]. 保定: 华北电力大学, 2017. [14] 杨海, 丁毅, 沈海斌. 基于改进萤火虫算法的SVM核参数选取. 计算机应用与软件, 2015, 32(6): 256-259. DOI:10.3969/j.issn.1000-386x.2015.06.063 [15] Kanimozhi T, Latha K. An integrated approach to region based image retrieval using firefly algorithm and support vector machine. Neurocomputing, 2015, 151: 1099-1111. DOI:10.1016/j.neucom.2014.07.078 [16] Ch S, Sohani SK, Kumar D, et al. A support vector machine-firefly algorithm based forecasting model to determine malaria transmission. Neurocomputing, 2014, 129: 279-288. DOI:10.1016/j.neucom.2013.09.030 [17] 王晓静, 彭虎, 邓长寿, 等. 基于均匀局部搜索和可变步长的萤火虫算法. 计算机应用, 2018, 38(3): 715-721. [18] Wang H, Cui ZH, Sun H, et al. Randomly attracted firefly algorithm with neighborhood search and dynamic parameter adjustment mechanism. Soft Computing, 2017, 21(18): 5325-5339. DOI:10.1007/s00500-016-2116-z [19] Yu SH, Zhu SL, Ma Y, et al. A variable step size firefly algorithm for numerical optimization. Applied Mathematics and Computation, 2015, 263: 214-220. DOI:10.1016/j.amc.2015.04.065 [20] 谢金鑫. 基于数据挖掘的雾霾天气影响因子研究[硕士学位论文]. 成都: 电子科技大学, 2014. [21] Zhang CH, Tian YJ, Deng NY. The new interpretation of support vector machines on statistical learning theory. Science in China Series A: Mathematics, 2010, 53(1): 151-164. [22] Fister I, Fister Jr I, Yang XS, et al. A comprehensive review of firefly algorithms. Swarm and Evolutionary Computation, 2013, 13: 34-46. DOI:10.1016/j.swevo.2013.06.001