基于GA-BP模型的短时交通流预测算法科研与实现
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">摘要</span></strong><span style="color: black;">:</span></span><span style="color: black;">为了实现<span style="color: black;">精细</span>、<span style="color: black;">有效</span>智能地监测交通流量变化<span style="color: black;">状况</span>,本文提出一种基于遗传算法改进的BP神经网络算法,构建<span style="color: black;">精细</span>的短时交通流预测模型。基于BP神经网络的结构和遗传算法的特点,总结了基于GA-BP短时交通流预测模型构建的全过程。<span style="color: black;">经过</span>对交通流特性以及短时交通流预测<span style="color: black;">办法</span>的分析,在<span style="color: black;">思虑</span>天气<span style="color: black;">原因</span>、节假日类型等多因素背景下,提取交通流预测模型的特征指标,并采用遗传算法对BP神经网络算法进行修改和优化,使得所<span style="color: black;">创立</span>的交通流预测模型均方误差降低23.96。<span style="color: black;">另外</span>,基于美国佐治亚州亚特兰大市观测到的真实交通流量数据,<span style="color: black;">经过</span>与传统BP神经网络模型以及WNN网络模型进行对比分析,验证算法的可行性及准确性。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">关键词:</strong></span><span style="color: black;"><strong style="color: blue;">智能交通、遗传算法、BP神经网络、交通流预测</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">1、</span>引言</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">随着社会经济快速发展,人民生活水平<span style="color: black;">持续</span><span style="color: black;">加强</span>,汽车保有量数目逐年攀升,交通拥堵<span style="color: black;">作为</span>世界各国都必须面对的<span style="color: black;">重点</span>问题。为<span style="color: black;">处理</span>这一问题,交通管理<span style="color: black;">分部</span>提出一系列<span style="color: black;">处理</span><span style="color: black;">方法</span>,<span style="color: black;">包含</span>限号、限行等,但<span style="color: black;">针对</span><span style="color: black;">持续</span>增长的交通流量,其<span style="color: black;">功效</span>微乎其微。随着计算机技术发展,智能交通系统(Intelligent Transportation Systems,ITS)应运而生。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">交通拥堵使得通行时间大幅<span style="color: black;">增多</span>,不仅给人们带来经济损失,<span style="color: black;">况且</span>在汽车排队等待的过程中,引擎仍<span style="color: black;">处在</span>运转状态,尾气<span style="color: black;">连续</span>向空气中排放<span style="color: black;">导致</span>环境污染。<span style="color: black;">按照</span>INRIX智能交通平台数据统计,2022年<span style="color: black;">全世界</span><span style="color: black;">因为</span>交通拥堵而<span style="color: black;">导致</span>的损失,如表1所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/2b351edbd83e4b37a035534ee64e717b~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=GOb9whwlfpjQPt73%2FeK9%2F5QCavU%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">表1 城市由交通拥堵而<span style="color: black;">导致</span>的损失排行统计表</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在这个科学快速发展、人工智能广泛应用的社会,<span style="color: black;">怎样</span>实施智能交通系统并利用各学科<span style="color: black;">行业</span>的<span style="color: black;">科研</span><span style="color: black;">办法</span>来预测<span style="color: black;">将来</span>一段时间内的交通流变化特性,已<span style="color: black;">作为</span>交通问题中急需<span style="color: black;">处理</span>的关键技术。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Hou等人提出了一种自适应混合模型来预测<span style="color: black;">短期</span>内的车辆行为,并结合了ARIMA<span style="color: black;">办法</span>和非线性小波神经网络<span style="color: black;">办法</span>来预测交通流量。然而,<span style="color: black;">科研</span>结果只<span style="color: black;">注重</span>了混合模型与单个模型的对比,但<span style="color: black;">无</span><span style="color: black;">思虑</span>其他效率更高的模型,例如<span style="color: black;">设备</span>学习或深度学习模型。Shen等人提出了一种基于混沌优化的向量<span style="color: black;">关联</span>性回归模型的多路口交通流预测体系,采用均方误差和百分比误差<span style="color: black;">评定</span>指标说明了其<span style="color: black;">办法</span><span style="color: black;">拥有</span>较好的精度能力。凌智<span style="color: black;">经过</span>分析高速路车流量数据特点,对BP神经网络预测模型的激励函数进行了改进,确定了预测模型中各参数的初始值的<span style="color: black;">办法</span>,<span style="color: black;">加强</span>了预测结果的精度。Jiang<span style="color: black;">创立</span>了一种基于BP神经网络和灰色理论的公路交通流预测模型,减小了传统BP神经网络的训练误差。<span style="color: black;">然则</span>,BP神经网络在初始权值和阈值的<span style="color: black;">选择</span>上完全随机,存在固有的收敛速度慢,易入局部极值等问题<span style="color: black;">引起</span>其适用性不强。<span style="color: black;">因此呢</span>,本文借助遗传算法的全局寻优能力,构建遗传算法优化下的BP神经网络短时交通流预测算法,<span style="color: black;">同期</span>分析交通流特性并提取影响<span style="color: black;">原因</span><span style="color: black;">做为</span>网络的输入,使改进的BP神经网络交通流预测模型能达到更好的预测结果。并<span style="color: black;">经过</span>实况数据验证了算法的优越性。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">2、</span>交通流特性与影响<span style="color: black;">原因</span>分析</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">交通流<span style="color: black;">指的是</span>车辆在道路上连续行驶的车流,交通流预测<span style="color: black;">便是</span>采用某种合适的模型,<span style="color: black;">按照</span><span style="color: black;">海量</span>的交通历史数据来预测<span style="color: black;">将来</span>时刻的交通<span style="color: black;">状况</span>,预测<span style="color: black;">目的</span>则是使预测结果尽可能接近真实交通<span style="color: black;">状况</span>。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">1.交通流的周期性分析</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">交通<span style="color: black;">行径</span>与人的出行作息密切<span style="color: black;">关联</span>。在当今社会,人们的出行<span style="color: black;">拥有</span><span style="color: black;">显著</span>的规律性,导致交通流变化存在周期<span style="color: black;">类似</span>性。在<span style="color: black;">1星期</span>中的工作日中,交通流呈现出规律的周期性,在工作日内交通流量随着昼夜的交替<span style="color: black;">显现</span>高峰与低谷,如图1所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/ab3d33f755734724ade61fffd743b06f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=phNy%2F97J0UkHJDq3hUpFx%2FsHc0g%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图1 <span style="color: black;">1星期</span>内工作日交通量变化图</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">2.交通流随机性分析</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">交通系统是一个由人、车、路和环境所<span style="color: black;">一起</span><span style="color: black;">形成</span>的一个<span style="color: black;">繁杂</span>系统,这就<span style="color: black;">引起</span>交通流呈现出很强的随机性。驾驶员<span style="color: black;">能够</span>有多种行驶<span style="color: black;">方法</span>,可能<span style="color: black;">由于</span>道路的拥堵<span style="color: black;">状况</span>而灵活<span style="color: black;">选取</span>出行路线,或临时改变目的调转方向,<span style="color: black;">亦</span>可能<span style="color: black;">由于</span>路况、车况等<span style="color: black;">原由</span>停滞不前。而间隔时间越短,交通流的随机性越<span style="color: black;">显著</span>,如图2所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/dcafbfe941914ac0803cca1f314a6205~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=r6O1PfEhdIrQ2gUdIpqQTdftMTY%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图2 <span style="color: black;">区别</span>时间间隔的交通流量变化</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">由图2分析可知,时间间隔越短交通流曲线表现出更强的波动性。<span style="color: black;">选择</span>时间间隔为15分钟的交通流数据进行预测,即<span style="color: black;">能够</span>最大限度地降低数据随机波动<span style="color: black;">导致</span>的预测误差,而又避免<span style="color: black;">长期</span>预测的不确定性。这使本<span style="color: black;">科研</span>对交通诱导<span style="color: black;">拥有</span><span style="color: black;">必定</span>的前瞻性,更好地<span style="color: black;">处理</span>交通拥堵问题。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">3.节假日<span style="color: black;">原因</span></strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在<span style="color: black;">1星期</span>内,工作日呈现出<span style="color: black;">类似</span>的变化模式,非工作日则<span style="color: black;">区别</span>,工作日与非工作日的变化模式交替<span style="color: black;">显现</span>。最典型的是,在工作日上下班交通路上还有<span style="color: black;">显著</span>的早晚高峰,而非工作日在午后一段时间<span style="color: black;">显现</span>一个不很<span style="color: black;">剧烈</span>但<span style="color: black;">连续</span>时间较长的高峰。如图3所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/c38f9bcd3615475aa09ab7351e48c31a~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=oRa%2BdyiyB65aE1eU4s1%2B6DQYUyY%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图3 <span style="color: black;">1星期</span>内工作日的交通流量变化</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">思虑</span>到周末和节假日对出行的影响,把<span style="color: black;">1星期</span>中的七天分为四类;表2清晰展示了<span style="color: black;">1星期</span>中<span style="color: black;">区别</span>类别的日子。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/0948862ca8b7432aa35a5deb689fe433~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=ES9mJsSuJmTA0tiQBBn48Yn%2BJiQ%3D" style="width: 50%; margin-bottom: 20px;"><span style="color: black;">表2 节假日类别表</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Ⅰ类:前一天是工作日的工作日;Ⅱ类:前一天是非工作日的工作日;Ⅲ类:前一天是工作日的非工作日;Ⅳ类:前一天是非工作日的非工作日。将量化后的节假日影响<span style="color: black;">原因</span><span style="color: black;">做为</span>交通流预测模型的一个输入变量输入到网络中进行预测。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">4.天气<span style="color: black;">原因</span></strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在道路交通出行中,出行者<span style="color: black;">选取</span>外出的<span style="color: black;">外边</span><span style="color: black;">要求</span>是自然环境,而<span style="color: black;">卑劣</span>的<span style="color: black;">外边</span>环境会严重制约人们的出行,影响道路的交通量。在大雾、大雪等的天气<span style="color: black;">原因</span>影响下,平均车速与正常天气下相比会呈现递减的变化。当天气<span style="color: black;">要求</span>为中雨或大雨时,<span style="color: black;">乃至</span>更<span style="color: black;">卑劣</span>的天气<span style="color: black;">情况</span>时,道路上的交通车速就会较晴天<span style="color: black;">显著</span>降低,<span style="color: black;">从而</span>使得交通流量降低。图4展示了<span style="color: black;">区别</span>天气<span style="color: black;">要求</span>下的车辆平均速度数据。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/ae64bfdbc8fd4ff281087d2192407168~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=nJsb5MKpxt9FI5idTff8Q2lPDZs%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图4 <span style="color: black;">区别</span>天气<span style="color: black;">要求</span>下的平均速度图</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">为了将天气指标<span style="color: black;">做为</span>变量输入本文所<span style="color: black;">创立</span>的预测模型,特将天气类别量化,如表3所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/a4eb209244774f6fb2a766ebdfca9e1b~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=9NiL2uP2FQ%2Fp3DGA%2BhP7nxG9ZcA%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">表3 天气类别量化表</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在<span style="color: black;">原因</span>的<span style="color: black;">选择</span>过程中,需要综合<span style="color: black;">思虑</span>。取的<span style="color: black;">太多</span>,某些<span style="color: black;">原因</span><span style="color: black;">拥有</span><span style="color: black;">关联</span>性,即会存在高度重合性;取的太少,<span style="color: black;">思虑</span>的<span style="color: black;">原因</span>不全,则会<span style="color: black;">由于</span>影响<span style="color: black;">原因</span>的缺失而使得预测数据不<span style="color: black;">拥有</span>真实<span style="color: black;">靠谱</span>性。<span style="color: black;">因此呢</span>,在<span style="color: black;">选择</span><span style="color: black;">原因</span>的过程中,需要多重<span style="color: black;">思虑</span>,<span style="color: black;">保准</span><span style="color: black;">选择</span>的<span style="color: black;">原因</span>全面性。综上所述,本<span style="color: black;">科研</span><span style="color: black;">重点</span>针对单一道路断面的交通流预测,<span style="color: black;">按照</span>交通流的特性和影响<span style="color: black;">原因</span>的分析,将交通流数据(15min)、天气和当天所属的类别(<span style="color: black;">是不是</span>为工作日)添加到训练模型中<span style="color: black;">做为</span>输入变量,输出变量为交通流的预测值。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">3、</span>BP神经网络的遗传算法改进</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">1.BP神经网络模型</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">BP神经网络是一种多层前馈神经网络,能够<span style="color: black;">经过</span>在信号和误差的传播过程中<span style="color: black;">持续</span>更新网络的权重和阈值来逼近高度非线性函数。网络<span style="color: black;">一般</span>有三层:输入层、<span style="color: black;">隐匿</span>层和输出层,如图5示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/a9d9e63988124d75932fb2e998c729b6~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=4aejLaenP%2Bes8ytcFoMRLp8zYl0%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图5 BP神经网络拓扑图</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">BP网络中,i,j分别<span style="color: black;">暗示</span>输入层,隐含层,xi<span style="color: black;">暗示</span>输入层的某个节点,n,m分别<span style="color: black;">暗示</span>输入层,隐含层的节点数。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">对输入层节点i有:xi,.(i=0,1,2...... ) </span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">隐含层节点h的计算公式为:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/120394c147364579a07d8c0fe3eb2ded~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=W4qTXxMepimq%2BXOj3K1gRr3ylLI%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">输出层节点y的计算公式为:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/2f14164c50d94b23ab4b09ddd80913df~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=z8dn3dO%2By%2BKE%2BrzlNbBJuwK4DcU%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">BP网络的学习过程<span style="color: black;">实质</span>上<span style="color: black;">便是</span>对网络联结权值和阈值的<span style="color: black;">调节</span>过程,利用给定的传播公式,沿着误差减小的方向<span style="color: black;">持续</span><span style="color: black;">调节</span>网络联结权重和阈值。在BP学习算法中,对样本集中的第r个样本,其输出层节点的期望输出用d_r<span style="color: black;">暗示</span>,<span style="color: black;">实质</span>输出用y<span style="color: black;">暗示</span>。其中d是已知的交通流量,y则由式(2)计算得出。<span style="color: black;">倘若</span>只是针对一个样本,<span style="color: black;">实质</span>输出与期望输出的误差定义为:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/8927f0717b41452dbee4b6ceb6a6d02e~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=mJ6ASCxCTk4ZX0D4N3SbdzHTYk4%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">学习过程中,其连接权值的<span style="color: black;">调节</span>变量</span><span style="color: black;">为对vj的<span style="color: black;">调节</span>:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/672283e98fc4458198ba433e8a5d02c5~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=SsXMuc7cSjk%2B1HdZaYD0D%2FMDGbQ%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">对w.ij的<span style="color: black;">调节</span>:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/57f652a953a647d691148f3e12ba7e1e~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=WF4eT%2Bi9mtfMNyELmKlm5P%2FiDc0%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在式(4)和式(5)中:v.jr 是第r次迭代时,从隐含层节点j到输出节点的连接权值;Δvjr是连接权值的变化量。wijr是第r次迭代时,从输入层节点i到隐含层节点j的连接权值,</span><span style="color: black;">Δwijr是连接权值的变化量。η为学习因子。 </span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">2. BP神经网络的GA参数优化</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">虽然BP神经网络<span style="color: black;">拥有</span>较强的非线性映射能力等优点,但<span style="color: black;">因为</span>其初始权值和阈值是随机生成的,<span style="color: black;">引起</span>该算法的网络性能较差,容易<span style="color: black;">因为</span>误差平方和函数的局部最小值的生成而陷入局部最优的陷阱,<span style="color: black;">导致</span>预测偏差。<span style="color: black;">另外</span>,面对大型训练集,BP神经网络学习过程的学习速度不稳定,收敛速度会非常慢,<span style="color: black;">引起</span>算法效率不高。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">为了<span style="color: black;">处理</span>BP神经网络算法的局限性和缺点,本文借助于在全局最优解搜索过程中<span style="color: black;">拥有</span><span style="color: black;">明显</span>效果的遗传算法来改进BP神经网络的缺陷。遗传算法(Genetic Algorithm,GA),是一种模拟遗传<span style="color: black;">选取</span>和自然淘汰生物进化过程的优化算法。该算法<span style="color: black;">拥有</span>更好的全局搜索性能,降低了局部最优解的<span style="color: black;">捕捉</span><span style="color: black;">危害</span>。利用遗传算法优化BP神经网络的权值和阈值<span style="color: black;">能够</span>避免BP神经网络<span style="color: black;">自己</span>随机生成的权重和阈值<span style="color: black;">引起</span>的预测偏差。基于遗传算法改进的GA-BP神经网络交通流量预测模型的<span style="color: black;">详细</span><span style="color: black;">过程</span>,如图6所示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/387b33e7925f4fc7b1a10c2e7ec79382~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=%2F7Q6Fd1zVB2Vj8lyBWfgaqXbyeY%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图6 遗传算法优化BP神经网络流程图</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">针对传统BP神经网络所存在的问题,<span style="color: black;">首要</span>采用BP神经网络的训练系统误差来<span style="color: black;">做为</span>遗传算法的<span style="color: black;">评估</span>标准,以寻找BP神经网络的最优初始权值和阈值,<span style="color: black;">而后</span>利用训练数据对所<span style="color: black;">创立</span>的交通流预测模型进行学习训练,从而得到最优的输入—输出映射模式。基于GA-BP神经网络的短时交通流量算法流程如下:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP1:种群初始化;</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">首要</span>对染色体进行定义。采用实数编码法将种群进行编码。针对交通流预测的BP神经网络模型,取网络所有的权值和阈值,<span style="color: black;">构成</span>N维向量,<span style="color: black;">做为</span>一个个体的染色体。<span style="color: black;">选取</span>种群规模M,随机生成一个M*N的矩阵<span style="color: black;">做为</span>初始种群。其中:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">N=输入向量个数×隐含层数+隐含层数+隐含层数×输出向量个数+输出向量个数;</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在本模型中,输入向量维度为6,<span style="color: black;">包含</span>过去4个时段的交通流历史数据、节假日数据和天气影响因子数据,输出向量维度为1,为当前预测交通流数据值。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP2:确定个体适应度函数;</span><span style="color: black;">遗传算法<span style="color: black;">针对</span>个体的优劣性是用适应度函数值来<span style="color: black;">评定</span>的,结合<span style="color: black;">选取</span>的适应度函数对个体进行筛选,<span style="color: black;">选取</span>适应度好的个体,淘汰适应度差的个体。<span style="color: black;">这儿</span>将各个个体基因进行<span style="color: black;">归类</span>,其数值分别<span style="color: black;">做为</span>权值和阈值代入到交通流预测的BP神经网络模型中,用网络训练后<span style="color: black;">得到</span>的预测误差值<span style="color: black;">做为</span>个体适应度函数:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/92b70cbadcc945e9bf7adb6189b97004~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=D8bBkds18n6erJWTWs0nzrOZt2c%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">式(6)中:F为个体适应度函数;x为神经网络输出层的节点数;i为节点数;o.i为第i个节点的期望输出;yi为网络第i个节点的预测输出;k为常数。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP3:<span style="color: black;">选取</span>操作;</span><span style="color: black;"><span style="color: black;">根据</span>个体适应度,采用轮盘赌法,<span style="color: black;">选取</span>优良个体遗传到下一个群体,轮盘赌算法的<span style="color: black;">重点</span>思想是各个个体的<span style="color: black;">选取</span>概率与其适应度函数值<span style="color: black;">体积</span>成正比。当种群规模为M时,则<span style="color: black;">每一个</span>个体i的<span style="color: black;">选取</span>概率pi为:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/71c708d5972b44a68b7b800877b3daf7~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=0UCWrfbdj%2Fd1nil%2FyBo0z6hdqu0%3D" style="width: 50%; margin-bottom: 20px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/4a18288d6fb64799aae4c4d43cdfd54b~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=DB6Auw9c2e%2FqjZj9jOl5CChdG9U%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">式(7)和式(8)中:p.i为第i个个体的<span style="color: black;">选取</span>概率;fi为第i个个体适应度值,M为种群规模。Fi为第i个个体的适应度函数;b为常数。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP4:交叉操作;</span><span style="color: black;">遗传算法的核心<span style="color: black;">便是</span>交叉操作,在这一环节可能会产生更加优良的个体品种。<span style="color: black;">由于</span>STEP1中采用实数编码法,<span style="color: black;">因此</span>交叉<span style="color: black;">办法</span><span style="color: black;">亦</span>采用实数交叉法。<span style="color: black;">针对</span>选中的成对个体,交换<span style="color: black;">她们</span>之间的部分染色体,由此产生新的个体。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/9601fb97b78e45dab71d778ac97c7286~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=KO8FeRO%2FQ01UY9K3t%2FtWg0cGdsU%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">式(9)和式(10)中:aci,aei分别为第c,e个染色体的i位;μ是之间的随机数。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP5:变异操作;</span><span style="color: black;">指定任选群体中的一个个体,为产生<span style="color: black;">更加多</span>优秀的个体,即使种群中产生<span style="color: black;">更加多</span>的交通流神经网络预测模型的权值与阈值解,保持种群的多样性,<span style="color: black;">同期</span>加强算法的搜索能力。对第i个个体的第j个基因进行变异操作。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">STEP6:把遗传算法优化计算得到的最优个体当作本文所<span style="color: black;">创立</span>的神经网络交通流预测模型的最佳权值和阈值,取代BP神经网络设定的初始值,得到遗传算法优化后的交通流预测模型,<span style="color: black;">而后</span>BP网络再进行新一轮的训练,就<span style="color: black;">能够</span>得到更为精确的交通流数据。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">4、</span>实验与结果分析</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">1.数据处理</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">为了验证本文算法的有效性,采用仿真的<span style="color: black;">办法</span>对文中提出的BP神经网络交通流预测模型进行预测分析,仿真数据采用乔治亚州梅肯杰克逊市121-0456观测点2022June.7-June.21所采集到的交通流量数据进行分析。采集间隔15分钟,一天有96组数据,15天总共1344组数据。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">思虑</span>到交通流的独特特性和预测精度,将输入数据归一化至范围,归化公式如下:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/e6dbd7497cf04195a5b848488c238954~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=uxS1OZ9iKTzlqv%2BxTvJ%2FS35uZrY%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在<span style="color: black;">以上</span>等式中,xi<span style="color: black;">暗示</span>原始输入,ynor<span style="color: black;">暗示</span>归一化值,max(x)<span style="color: black;">暗示</span>样本中的最大值,以及min(x)<span style="color: black;">暗示</span>样本中的最小值。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">2.算法的仿真测试设置</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在仿真实验中,采用三层BP神经网络结构,分别将预测前四个时段的历史交通流数据、节假日类型数据和天气影响<span style="color: black;">原因</span>数据<span style="color: black;">做为</span>网络模型输入样本,预测交通流数据<span style="color: black;">做为</span>网络的输出。隐含层神经元个数设置为9个。输出层传递函数设置为traingdx传递函数,网络训练函数设置为trainsig函数。最大训练次数设置为100,学习率设置为0.001,<span style="color: black;">选择</span>13天的数据<span style="color: black;">做为</span>训练样本,第14天的随机50组数据<span style="color: black;">做为</span>验证样本。成功构建交通流预测模型后输入训练数据,满足<span style="color: black;">以上</span>设置<span style="color: black;">要求</span>后终止训练。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">3.仿真分析</strong></span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">本文采用平均绝对百分比误差(MAPE)、均方误差(MSE)和均方根误差(RMSE)<span style="color: black;">做为</span>算法性能度量指标,并将<span style="color: black;">区别</span>模型的预测值与真实值和绝对误差进行比较。均方误差的<span style="color: black;">体积</span><span style="color: black;">暗示</span>预测值与平均值的偏差,且均方误差越大,预测结果越差。<span style="color: black;">以上</span><span style="color: black;">评估</span>指标的公式如下:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/59b5f436a089449b887a433961cee7f3~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=s%2FpYdg4o%2BxLjEZYekGAigF0R21M%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">其中,Yi为样本真实值,yi为预测值,n为样本数量。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">为了更好地验证网络模型的有效性及准确性,将优化后的GA-BP神经网络交通流量预测模型,分别与传统的BP神经网络预测模型以及应用较为广泛的小波神经网络(Wavelet Neural Network,WNN)预测模型进行对比测试,测试结果如图7、图8、图9所示。各参数预测结果的误差<span style="color: black;">评估</span>指标值,如表4示。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/f70b79f95bb2499eb5e4fa40036a7f6c~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=%2FurIlKjeZifTd3uLHuVUmSOa1l4%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图7 BP神经网络预测值对比图(测试数据)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p26-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/835dcd301a4f43ea874f61ae1b02ace3~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=swwdi8mqun%2ByhDzBq2t3RRTciJc%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图8 WNN神经网络预测值对比图(测试数据)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/3ef2a507eb284068849051d0a43abd24~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=%2BikzukyKcI%2ByjZ5g%2BD94xrpKcpU%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图9 GA-BP神经网络预测值对比图(测试数据)</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">从图7、图8和图9中分析说明,利用优化后的预测算法得到的预测结果的变化趋势,相比于传统的BP神经网络、WNN模型预测结果与期望输出更加吻合,预测值更接近真实值。表4<span style="color: black;">能够</span>反映出<span style="color: black;">经过</span>对三个模型的仿真测算,基于遗传算法优化后的BP预测模型在平均绝对百分比误差MAPE,均方根误差RMSE和均方误差MSE三个指标上相<span style="color: black;">针对</span>优化前的预测模型均有所降低,说明优化后的预测模型更加精确。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/d4fc55fc43474b1aa57dd198f1050739~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1725644757&x-signature=fAfPDtfAwSnsSlTt8coWc7Y%2FVWU%3D" style="width: 50%; margin-bottom: 20px;"></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">表4 <span style="color: black;">区别</span>模型的<span style="color: black;">评估</span>指标</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">5、</span>结语</strong></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">本文基于BP神经网络的特征和遗传算法的原理,提出一种基于遗传算法优化的BP神经网络交通流预测模型,在<span style="color: black;">思虑</span>天气<span style="color: black;">原因</span>、节假日类型等多<span style="color: black;">原因</span>背景下,提取出交通流预测模型的特征指标,并将其与交通流量数据结合,构建交通流量预测模型;以美国佐治亚州的真实交通流数据对算法进行了验证;<span style="color: black;">另外</span>,在交通流预测任务中,空间依赖性受道路拓扑结构的影响使其<span style="color: black;">拥有</span>高度动态性。<span style="color: black;">因此呢</span>,有必要<span style="color: black;">捉捕</span>节点间的动态空间依赖性以<span style="color: black;">加强</span>交通流预测精度。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">吉林省教育厅<span style="color: black;">研究</span>项目:JJKH20220057KJ</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">参考文献:</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">《中国公路学报》编辑部.中国交通工程学术<span style="color: black;">科研</span>综述·2016.中国公路学报,2016,29(06):1-161.DOI:10.19721/j.cnki.1001-7372.</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2016.06.001.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Purnendu S M Tripathi, Ambuj Kumar, Ashok Chandra. An Overview of Intelligent Transport System (ITS) and Its Applications. Journal of Mobile Multimedia, 2021, 17: 1-3.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">INRIX 2022 Global Traffic Scorecard: London Tops List as Most Congested City, U.S. Cities InchCloser.(2023-01-10).https://inrix.com/press-releases/2022-global-traffic-scorecard-uk/.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Dong, S., Li, R. Traffic identification method based on multiple probabilistic neural network model. Neural Comput & Applic 31, 473–487 (2019).</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Lun-hui XU, Xiang-xue W (2016) Application of SVD-basedoptimized robust UKF algorithm to estimation of short-termtraffic flow state. J Southwest Jiaotong Univ 44(12):44–52.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Chen D, Hu M, Zhang H et al (2016) Short-term traffic flow prediction of airspace sectors based on bayesian estimation the-ory. Xinan Jiaotong Daxue Xuebao/J Southwest Jiaotong Univ51(4):807–814.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Z. Shen, W. Wang, Q. Shen, S. Zhu, H.M. Fardoun, . Lou, A novel learningmethod for multi-intersections aware traffic flow forecasting, Neurocomputing398 (2020) 477–484.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">凌智.基于BP神经网络的高速公路车流量预测<span style="color: black;">科研</span>.武汉:武汉理工大学,2013.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Jiang, Z. (2022). Highway traffic flow prediction model construction based on the gray theory and BP neural network. Computational intelligence and neuroscience, 2022.</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">马永杰,云文霞.遗传算法<span style="color: black;">科研</span><span style="color: black;">发展</span>.计算机应用<span style="color: black;">科研</span>,2012,29(04):1201-1206+1210.</p>
楼主继续加油啊!外链论坛加油! 谷歌外贸网站优化技术。 对于这个问题,我有不同的看法...
页:
[1]