✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,
代码获取、论文复现及科研仿真合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab完整代码及仿真定制内容点击👇
🔥 内容介绍
基于生物地理学算法 (BBO) 优化多层感知器MLP实现数据分类含 PSO、ACO、ES、GA 算法
生物地理学算法 (BBO) 是一种基于生物地理学理论的启发式算法,它模拟了生物种群在地理环境中的迁徙和适应过程。这种算法被广泛应用于解决优化问题,如数据分类、函数优化等。在本文中,我们将介绍如何利用BBO算法优化多层感知器 (MLP) 实现数据分类,并比较其与其他常见优化算法如粒子群算法 (PSO)、蚁群算法 (ACO)、进化策略 (ES)、遗传算法 (GA) 的性能。
多层感知器是一种常见的人工神经网络结构,它由多个神经元层组成,每个神经元层都与下一层全连接。MLP在数据分类、模式识别等领域有着广泛的应用,但其性能很大程度上取决于网络结构和参数的选择。因此,优化MLP的结构和参数对于提高其分类性能至关重要。
在本研究中,我们提出了一种基于BBO算法的MLP优化方法。首先,我们将MLP的结构和参数表示为一个优化问题,其中目标是最大化分类准确率。然后,我们利用BBO算法来搜索最优解,通过模拟生物种群的迁徙和适应过程,不断优化MLP的结构和参数。实验结果表明,基于BBO算法的MLP优化方法在数据分类任务中取得了较好的性能,相较于传统的PSO、ACO、ES、GA算法,具有更快的收敛速度和更高的分类准确率。
与PSO算法相比,BBO算法能够更好地避免陷入局部最优解,同时具有更强的全局搜索能力。与ACO算法相比,BBO算法能够更快地收敛到最优解,同时具有更好的鲁棒性。与ES算法相比,BBO算法能够更稳定地优化MLP的结构和参数,同时具有更高的分类准确率。与GA算法相比,BBO算法能够更快地找到最优解,同时具有更好的收敛性能。
基于生物地理学的优化器 (BBO) 被用作多层感知器 (MLP) 的训练器。当前的源代码是用于解决虹膜分类问题的 BBO-MLP 训练器的演示。本次提交中还有其他训练器:粒子群优化(PSO)、蚁群优化(ACO)、遗传算法(GA)、进化策略(ES)和基于概率的增量学习(PBIL)。BBO-MLP 的分类精度在 main.m 文件末尾计算,并与 PSO、ACO、ES、GA 和 PBIL 的分类精度进行比较。最后绘制了各算法的收敛曲线和分类精度。
综上所述,基于BBO算法的MLP优化方法在数据分类任务中具有较好的性能,相较于传统的PSO、ACO、ES、GA算法,具有更快的收敛速度和更高的分类准确率。未来,我们将进一步研究BBO算法在其他优化问题中的应用,并探索其在神经网络优化中的潜在价值。
📣 部分代码
% Biogeography-Based Optimization (BBO) trainer for MLP %% source codes version 1 %% %clcclear allclose all% For modifying initial parameters please have a look at init.m filedisplay('..........................................................................................')display('BBO is training MLP ...')display('..........................................................................................')[cg_curve1,Hamming,best] = BBO(@MLP_Iris, 1, 1, 300); % BBO trainerBest_W_B(1,:)=best;display('..........................................................................................')display('PSO is training MLP ...')display('..........................................................................................')[cg_curve2,best]= PSO(@MLP_Iris, 1); % PSO trainerBest_W_B(2,:)=best;display('..........................................................................................')display('GA is training MLP ...')display('..........................................................................................')[cg_curve3,best]= GA(@MLP_Iris, 1); % GA trainerBest_W_B(3,:)=best;display('..........................................................................................')display('ACO is training MLP ...')display('..........................................................................................')[cg_curve4,best]= ACO(@MLP_Iris, 1); % ACO trainerBest_W_B(4,:)=best;display('..........................................................................................')display('ES is training MLP ...')display('..........................................................................................')[cg_curve5,best]= ES(@MLP_Iris, 1); % ES trainerBest_W_B(5,:)=best;display('..........................................................................................')display('PBIL is training MLP ...')display('..........................................................................................')[cg_curve6,best]=PBIL(@MLP_Iris, 1); % PBIL trainerBest_W_B(6,:)=best;% Calculating classification ratesload iris.txtx=sortrows(iris,2);H2=x(1:150,1);H3=x(1:150,2);H4=x(1:150,3);H5=x(1:150,4);T=x(1:150,5);H2=H2';[xf,PS] = mapminmax(H2); % Normalzation of inputI2(:,1)=xf;H3=H3';[xf,PS2] = mapminmax(H3); % Normalzation of inputI2(:,2)=xf;H4=H4';[xf,PS3] = mapminmax(H4); % Normalzation of inputI2(:,3)=xf;H5=H5';[xf,PS4] = mapminmax(H5); % Normalzation of inputI2(:,4)=xf;Thelp=T;T=T';[yf,PS5]= mapminmax(T); % Normalzation of outputT=yf;T=T';for i=1:6Rrate=0;W=Best_W_B(i,1:63);B=Best_W_B(i,64:75);for pp=1:150actualvalue=my_MLP(4,9,3,W,B,I2(pp,1),I2(pp,2), I2(pp,3),I2(pp,4));if(T(pp)==-1)if (actualvalue(1)>=0.95 && actualvalue(2)<0.05 && actualvalue(3)<0.05)Rrate=Rrate+1;endendif(T(pp)==0)if (actualvalue(1)<0.05 && actualvalue(2)>=0.95 && actualvalue(3)<0.05)Rrate=Rrate+1;endendif(T(pp)==1)if (actualvalue(1)<0.05 && actualvalue(2)<0.05 && actualvalue(3)>=0.95)Rrate=Rrate+1;endendendFinal_Classification_Rates(1,i)=(Rrate/150)*100;enddisplay('--------------------------------------------------------------------------------------------')display('Classification rate')display(' BBO PSO GA ACO ES PBIL')display(Final_Classification_Rates(1:6))display('--------------------------------------------------------------------------------------------')figure('Position',[500 500 660 290])%Draw convergence curvessubplot(1,2,1);hold ontitle('Convergence Curves')semilogy(cg_curve1,'Color','r')semilogy(cg_curve2,'Color','k')semilogy(cg_curve3,'Color','b')semilogy(cg_curve4,'Color','r')semilogy(cg_curve5,'Color','g')semilogy(cg_curve6,'Color','c')xlabel('Generation');ylabel('MSE');axis tightgrid onbox onlegend('BBO','PSO', 'GA', 'ACO', 'ES', 'PBIL')%Draw classification ratessubplot(1,2,2);hold ontitle('Classification Accuracies')bar(Final_Classification_Rates)xlabel('Algorithm');ylabel('Classification rate (%)');grid onbox onset(gca,'XTickLabel',{'BBO','PSO', 'GA', 'ACO', 'ES', 'PBIL'});
⛳️ 运行结果

🔗 参考文献
S. Mirjalili, SM Mirjalili, A. Lewis, Let A Biogeography-Based Optimizer Train Your Multi-Layer Perceptron, Information Sciences, In press, 2014, DOI: http://dx . doi.org/10.1016/j.ins.2014.01.038
2万+

被折叠的 条评论
为什么被折叠?



