基于混合生物地理学的优化萤火虫算法研究(Matlab代码实现)

简介: 基于混合生物地理学的优化萤火虫算法研究(Matlab代码实现)

🍁🥬🕒摘要🕒🥬🍁

针对传统多目标算法在应用中解决多目标优化问题时存在的Pareto前沿收敛不好、解集均匀性差等问题,文章通过实例对混合生物地理学算法(HBBO)进行研究和综合分析,将其与优化萤火虫算法相互结合来求解多目标优化的问题。


✨🔎⚡运行结果⚡🔎✨

💂♨️👨‍🎓Matlab代码👨‍🎓♨️💂

%% Making Things Ready
clc;
clear;
warning('off');
%% Music Signal Loading
[signal,fs] = audioread('Setar.wav');
win = 0.050;
step = 0.050;
fs=44100;
%% Time Domain Features
EnergyEntropy = Energy_Entropy_Block(signal, win*fs, step*fs, 10)';
ShortTimeEnergy = ShortTimeEnergy(signal, win*fs, step*fs);
%% Frequency Domain Features
SpectralCentroid = SpectralCentroid(signal, win*fs, step*fs, fs);
SpectralFlux = SpectralFlux(signal,win*fs, step*fs, fs);
%% Making Inputs and Targets
Inputs=[EnergyEntropy SpectralCentroid SpectralFlux]';
Targets=ShortTimeEnergy';
data.Inputs=Inputs;
data.Targets=Targets;
data=JustLoad(data);
%% Generate Basic Fuzzy Model
ClusNum=3; % FCM Cluster Number
fis=GenerateFuzzy(data,ClusNum);
%% BBO-FireFly Algorithm Learning
BBOFuzzy=BBOFCN(fis,data);  
BBOFireFlyFuzzy=FireFlyFCN(BBOFuzzy,data);   
%% BBO-FireFly Results 
% BBO-FireFly 
TrTar=data.TrainTargets;
TrainOutputs=evalfis(data.TrainInputs,BBOFireFlyFuzzy);
% Basic and BBO-FireFly Models
BasicFeature=data.TrainTargets;
BBOFireFly=TrainOutputs;
% BBO-FireFly Train Errors Calculations
Errors=data.TrainTargets-TrainOutputs;
MSE=mean(Errors.^2);
RMSE=sqrt(MSE);  
error_mean=mean(Errors);
error_std=std(Errors);
%% BBO-FireFly Algorithm Plots
% Plot Input Signal
figure('units','normalized','outerposition',[0 0 1 1])
subplot(4,1,1);
plot(signal);
title('Input Audio Signal');
grid on;
% Plot Train Result
subplot(4,1,2);
plot(data.TrainTargets,'--',...
'LineWidth',2,...
'MarkerSize',3,...
'MarkerEdgeColor','b',...
'Color',[0.0,0.0,0.9]);
hold on;
plot(TrainOutputs,'-',...
'LineWidth',2,...
'MarkerSize',3,...
'MarkerEdgeColor','m',...
'Color',[0.9,0.9,0.0]);
legend('Basic Model','BBO-FireFly Model');
title('BBO-FireFly Signal Trained');
xlabel('Sample Index');
grid on;
% Plot Distribution Fit Histogram
subplot(4,1,3);
h=histfit(Errors, 80);
h(1).FaceColor = [.3 .7 0.7];
title([' BBO-FireFly Train Error  =   ' num2str(RMSE)]);
% Plot Signals
subplot(4,1,4);
plot(normalize(EnergyEntropy),'-^');hold on;
plot(normalize(SpectralCentroid),'-o');hold on;
plot(normalize(SpectralFlux),'-d');hold on;
plot(normalize(ShortTimeEnergy),'-s');hold on;
plot(normalize(BBOFireFly),'-*');
hold off;
legend('Energy Entropy','Spectral Centroid', 'Spectral Flux', 'Short Time Energy', 'BBO-FireFly');
title('All Signals');
grid on;
%% Regression Line
[population2,gof] = fit(BasicFeature,BBOFireFly,'poly4');
figure;
plot(BasicFeature,BBOFireFly,'o',...
    'LineWidth',1,...
    'MarkerSize',8,...
    'MarkerEdgeColor','g',...
    'MarkerFaceColor',[0.9,0.2,0.2]);
    title(['BBO FireFly Train - R =  ' num2str(1-gof.rmse)]);
        xlabel('Train Target');
    ylabel('Train Output');   
hold on
plot(population2,'b-','predobs');
    xlabel('Train Target');
    ylabel('Train Output'); 
    grid on;
hold off;


📜📢🌈参考文献🌈📢📜

[1]张丹丽,高彦杰.多目标的混合生物地理学优化算法研究[J].科技创新与应用,2022,12(01):21-23+27.DOI:10.19981/j.CN23-1581/G3.2022.01.005.

相关文章
|
7月前
|
算法 定位技术 计算机视觉
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
887 0
|
7月前
|
算法 机器人 计算机视觉
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
235 0
|
7月前
|
机器学习/深度学习 算法 机器人
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
340 8
|
7月前
|
机器学习/深度学习 编解码 算法
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
339 8
|
7月前
|
机器学习/深度学习 算法 机器人
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
694 0
|
7月前
|
数据采集 分布式计算 并行计算
mRMR算法实现特征选择-MATLAB
mRMR算法实现特征选择-MATLAB
431 2
|
8月前
|
存储 编解码 算法
【多光谱滤波器阵列设计的最优球体填充】使用MSFA设计方法进行各种重建算法时,图像质量可以提高至多2 dB,并在光谱相似性方面实现了显著提升(Matlab代码实现)
【多光谱滤波器阵列设计的最优球体填充】使用MSFA设计方法进行各种重建算法时,图像质量可以提高至多2 dB,并在光谱相似性方面实现了显著提升(Matlab代码实现)
252 6
|
8月前
|
传感器 机器学习/深度学习 编解码
MATLAB|主动噪声和振动控制算法——对较大的次级路径变化具有鲁棒性
MATLAB|主动噪声和振动控制算法——对较大的次级路径变化具有鲁棒性
361 3
|
7月前
|
机器学习/深度学习 算法 自动驾驶
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
390 8
|
7月前
|
机器学习/深度学习 算法 数据可视化
基于MVO多元宇宙优化的DBSCAN聚类算法matlab仿真
本程序基于MATLAB实现MVO优化的DBSCAN聚类算法,通过多元宇宙优化自动搜索最优参数Eps与MinPts,提升聚类精度。对比传统DBSCAN,MVO-DBSCAN有效克服参数依赖问题,适应复杂数据分布,增强鲁棒性,适用于非均匀密度数据集的高效聚类分析。