计算机系统应用  2019, Vol. 28 Issue (7): 109-113 PDF

Adaptive Genetic Annealing Algorithm for Optimizing BP Neural Network and its Application
PEI Rui, BAI Shang-Wang, DANG Wei-Chao, PAN Li-Hu
School of Computer Science and Technology, Taiyuan University of Science and Technology, Taiyuan 030024, China
Foundation item: Science and Technology Collaborative Program Between Shanxi Province and Chinese Academy of Sciences (20141101001); Key Research and Development Program for General Industry of Shanxi Province (201703D121042-1); Science and Technology Program for Social Development of Shanxi Province (20140313020-1)
Abstract: In order to improve the prediction accuracy of software aging, a New Adaptive Genetic Simulated Annealing algorithm (NAGSA) is proposed to optimize the BP neural network prediction model. The model’s selection operator is combined with the elite retention strategy using the roulette selection method, stretching the fitness function by simulated annealing algorithm in the late iteration. Compared with the traditional Adaptive Genetic Algorithm (AGA), it can adaptively adjust the crossover probability and mutation probability nonlinearly when the individual fitness is low, thereby optimizing and weighting the BP neural network weights and thresholds, injecting a memory leak code into the online book-sending website to age it, collecting the aging data required for the experiment for simulation training. The experimental results show that the BP neural network model optimized by the NAGSA-BP model compared with the traditional Genetic Algorithm (GA), traditional AGA, and traditional Adaptive Genetic Simulated Annealing algorithm (NGSA) improves the prediction accuracy and achieves excellent results. The effectiveness of the proposed method is verified in this application field.
Key words: optimization     BP neural network     genetic algorithm     simulated annealing algorithm

1 BP神经网络

BP(Back Propagation)神经网络是目前应用较广泛的一种多层前馈型神经网络, 其网络训练采用误差逆传播算法[7], 它可以拟合任意的非线性映射从而降低预测误差. 现有的基于BP神经网络模型虽在一定程度上取得了进展, 但是依旧存在一些不足需加以改进.

2 自适应遗传退火算法优化BP神经网络 2.1 遗传算法优化BP神经网络模型

2.2 新型自适应遗传退火算法 2.2.1 编码

 $H = n \times l + l \times m + l + m$

2.2.2 选择算子

2.2.3 适应度

 \begin{aligned} {F_i} & = {{{e^{{{{f_i}} /T}}}} / {\sum\limits_{i - 1}^M {{e^{{{{f_i}} / T}}}} }}\\ T & = {T_0}\left( {{{0.99}^{g - 1}}} \right) \end{aligned}

2.2.4 交叉、变异操作

 \begin{aligned} {P_c} = \left\{ \begin{array}{l} {k_1}\left( {1 - \dfrac{{\arcsin \left( {{{{f_a}} / {{f_m}}}} \right)}}{{{\pi / 2}}}} \right),\;\;\;\;{\rm{arcsin}}\left( {{{{f_a}}/ {{f_m}}}} \right) \geqslant {\pi / 6} \\ {k_1}\dfrac{{\arcsin \left( {{{{f_a}} / {{f_m}}}} \right)}}{{{\pi / 2}}},\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;{\rm{arcsin}}\left( {{{{f_a}} / {{f_m}}}} \right) < {\pi / 6} \\ \end{array} \right. \\ {P_m} = \left\{ \begin{array}{l} {k_2}\left( {1 - \dfrac{{\arcsin \left( {{{{f_a}} /{{f_m}}}} \right)}}{{{\pi / 2}}}} \right),\;\;\;\;{\rm{arcsin}}\left( {{{{f_a}} / {{f_m}}}} \right) < {\pi / 6} \\ {k_2}\dfrac{{\arcsin \left( {{{{f_a}} / {{f_m}}}} \right)}}{{{\pi / 2}}},\;\;\;\;\;\;\;\;\;\;\;\;\;\;{\rm{arcsin}}\left( {{{{f_a}} / {{f_m}}}} \right) \geqslant {\pi / 6} \\ \end{array} \right. \end{aligned}

3 实验验证 3.1 数据获取

 图 1 JVM中的内存泄漏

 图 2 JVM在120 s内平均使用内存变化趋势图

3.2 仿真实验 3.2.1 数据预处理

3.2.2 建立训练模型

 $MAE = \frac{1}{n}\sum^{n}_{h=1}{|M_h-P_h|}\;\;\;\;\;\;\;\;\;\;\;MSE =\frac{1}{n}\sum^{n}_{h=1}{(M_h-P_h)^2}$

 图 3 预测输出与期望输出对比图

 图 4 误差对比图

4 结束语

 [1] Yan YQ, Guo P, Cheng B, et al. An experimental case study on the relationship between workload and resource consumption in a commercial web server. Journal of Computational Science, 2018, 25: 183-192. DOI:10.1016/j.jocs.2017.05.019 [2] Zhao J, Trivedi KS, Grottke M, et al. Ensuring the performance of apache HTTP server affected by aging. IEEE Transactions on Dependable and Secure Computing, 2014, 11(2): 130-141. DOI:10.1109/TDSC.2013.38 [3] Cotroneo D, Natella R, Pietrantuono R, et al. Software aging analysis of the linux operating system. Proceedings of the IEEE 21st International Symposium on Software Reliability Engineering. San Jose, CA, USA. 2010. 71-80. [4] Bovenzi A, Cotroneo D, Pietrantuono R, et al. On the aging effects due to concurrency bugs: A case study on MySQL. Proceedings of the IEEE 23rd International Symposium on Software Reliability Engineering. Dallas, TX, USA. 2012. 211-220. [5] Araujo J, Matos R, Maciel P, et al. Experimental evaluation of software aging effects on the eucalyptus cloud computing infrastructure. Proceedings of the Middleware 2011 Industry Track Workshop. Lisbon, Portugal. 2011. 4. [6] Machida F, Kim DS, Trivedi KS. Modeling and analysis of software rejuvenation in a server virtualized system. Proceedings of 2010 IEEE Second International Workshop on Software Aging and Rejuvenation. San Jose, CA, USA. 2011. 1-6. [7] Huang DM, He SQ, He XH, et al. Prediction of wind loads on high-rise building using a BP neural network combined with POD. Journal of Wind Engineering and Industrial Aerodynamics, 2017, 170: 1-17. DOI:10.1016/j.jweia.2017.07.021 [8] 闫春, 厉美璇, 周潇. 基于改进的遗传算法在函数优化中的应用. 计算机应用研究, 2019, 36(10): 1-6. [9] 刘飞. Java虚拟机内存管理与内存泄漏. 信息与电脑, 2017(6): 69-71. DOI:10.3969/j.issn.1003-9767.2017.06.025 [10] Matias R, Barbetta PA, Trivedi KS, et al. Accelerated degradation tests applied to software aging experiments. IEEE Transactions on Reliability, 2010, 59(1): 102-114. DOI:10.1109/TR.2009.2034292