# 【DDoS攻击检测】基于改进的非洲秃鹫优化算法和一种新的DDoS攻击检测传递函数的特征选择方法（Matlab代码实现）

+关注继续查看

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势：🌞🌞🌞博客内容尽量做到思维缜密，逻辑清晰，为了方便读者。

⛳️座右铭：行百里者，半于九十。

📋📋📋本文目录如下：🎁🎁🎁

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现

# 📚2 运行结果

function [Best_vulture1_F,Best_vulture1_X]=sin_cos_bIAVOA(pop_size,max_iter,dim,fobj)

lower_bound=-6;upper_bound=6;
% initialize Best_vulture1, Best_vulture2
Best_vulture1_X=zeros(1,dim);
Best_vulture1_F=inf;
Best_vulture2_X=zeros(1,dim);
Best_vulture2_F=inf;
%Initialize the first random population of vultures
X=double(initialization(pop_size,dim,1,0)>0.5);
%%  Controlling parameter
p1=0.6;
p2=0.4;
p3=0.6;
alpha=0.8;
betha=0.2;
gamma=2.5;
%%Main loop
current_iter=0; % Loop counter
while current_iter < max_iter
for i=1:size(X,1)

S1=cos(X(i,:))/2+0.5;
X1=rand(1,dim)<S1;
ObjVal1=feval(fobj,X1);
S2=sin(X(i,:))/2+0.5;
X2=rand(1,dim)<S2;
ObjVal2=feval(fobj,X2);
XX=[X1;X2];

fiti=[ObjVal1;ObjVal2];
[~,ind]=min(fiti(:,1));
X(i,:)=XX(ind,:);
current_vulture_X = X(i,:);
current_vulture_F=fiti(ind,:);
fit(i,:)=fiti(ind,:);

% Update the first best two vultures if needed and Calculate the fitness of the population
if current_vulture_F(1)<Best_vulture1_F(1)
Best_vulture1_F=current_vulture_F; % Update the first best bulture
Best_vulture1_X=current_vulture_X;
end
if current_vulture_F(1)>Best_vulture1_F(1) && ...
current_vulture_F(1)<Best_vulture2_F(1)
Best_vulture2_F=current_vulture_F; % Update the second best bulture
Best_vulture2_X=current_vulture_X;
end
end
worst=max(fit(:,1));
a=unifrnd(-2,2,1,1)*((sin((pi/2)*(current_iter/max_iter))^gamma)+cos((pi/2)*(current_iter/max_iter))-1);
P1=(2*rand+1)*(1-(current_iter/max_iter))+a;
% Update the location
for i=1:size(X,1)
current_vulture_X = X(i,:);  % pick the current vulture back to the population
F=P1*(2*rand()-1);
random_vulture_X=random_select(Best_vulture1_X,Best_vulture2_X,alpha,betha);
if (current_iter<=(1/3*max_iter))

current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound);
% Exploitation:
elseif (current_iter>(1/3*max_iter)&&  (current_iter<=(2/3*max_iter)))
prob=(fit(i)-worst)/(Best_vulture1_F(1)-worst);
if (prob>0.4)
current_vulture_X= exploitation(current_vulture_X, Best_vulture1_X, Best_vulture2_X, random_vulture_X, F, p2, p3, dim, upper_bound, lower_bound);
else
current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound);
end
else
current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound);
end
X(i,:) = current_vulture_X; % place the current vulture back into the population
end

current_iter=current_iter+1;

X = boundaryCheck(X, lower_bound, upper_bound);
fprintf('Iteration=%d Best_Fitness(Fitness Function,Accuracy,Precision,Recall,Specificity)=%f,%f,%f,%f,%f\n', current_iter,Best_vulture1_F );

end

end

# 🎉3 参考文献

[1]Zakieh Sharifian, Behrang Barekatain, Alfonso Ariza Quintana, Zahra Beheshti, Faramarz Safi-Esfahani (2023), Sin-Cos-bIAVOA: A new feature selection method based on improved African vulture optimization algorithm and a novel transfer function to DDoS attack detection, Expert System with Application, https://doi.org/10.1016/j.eswa.2023.120404

# 🌈4 Matlab代码实现

|
26天前
|

21 0
|
29天前
|

DDoS攻击
DDoS攻击
38 1
|
2月前
|

20 0
|
2月前
|

Django防止DDOS攻击的措施
Django防止DDOS攻击的措施
23 0
|
3月前
|

47 0
|
4月前
|

DDOS攻击成本高昂，与防御成本紧密相连110.42.2.1
DDOS攻击成本高昂，与防御成本紧密相连110.42.2.1
86 0
|
4月前
|

DoS和DDoS攻击
DoS和DDoS攻击
365 0
|
5月前
|

44 0
|
6月前
|

188 0
|
6月前
|

293 0