[go: up one dir, main page]

CN113139598A - Intrusion detection method and system based on improved intelligent optimization algorithm - Google Patents

Intrusion detection method and system based on improved intelligent optimization algorithm Download PDF

Info

Publication number
CN113139598A
CN113139598A CN202110434602.8A CN202110434602A CN113139598A CN 113139598 A CN113139598 A CN 113139598A CN 202110434602 A CN202110434602 A CN 202110434602A CN 113139598 A CN113139598 A CN 113139598A
Authority
CN
China
Prior art keywords
population
individuals
individual
fitness value
fitness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110434602.8A
Other languages
Chinese (zh)
Other versions
CN113139598B (en
Inventor
李肯立
杜亮
余思洋
段明星
肖国庆
唐卓
廖清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University filed Critical Hunan University
Priority to CN202110434602.8A priority Critical patent/CN113139598B/en
Publication of CN113139598A publication Critical patent/CN113139598A/en
Application granted granted Critical
Publication of CN113139598B publication Critical patent/CN113139598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Virology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an intrusion detection method based on an improved intelligent optimization algorithm, which comprises the following steps: acquiring a data set, and carrying out standardization processing on the data set by using a z-score method to obtain a standardized data set; optimizing a penalty coefficient C and a kernel coefficient gamma of the kernel-limit learning machine model by improving an intelligent optimization algorithm, and obtaining an optimized kernel-limit learning machine model; and training the optimized kernel limit learning machine model to obtain a trained kernel limit learning machine model, and classifying the data set by using the trained kernel limit learning machine to obtain a classification result. The invention can solve the technical problems of low convergence rate, easy trapping in local optimal traps and weak global search capability of the existing intrusion detection method based on single intelligent optimization algorithm; and the technical problems of low algorithm iteration efficiency and poor calculation precision of the existing intrusion detection method based on various intelligent optimization algorithms.

Description

一种基于改进智能优化算法的入侵检测方法和系统An intrusion detection method and system based on an improved intelligent optimization algorithm

技术领域technical field

本发明属于信息安全技术领域,更具体地,涉及一种基于改进智能优化算法的入侵检测方法和系统。The invention belongs to the technical field of information security, and more particularly, relates to an intrusion detection method and system based on an improved intelligent optimization algorithm.

背景技术Background technique

随着网络信息化程度的逐渐提高,网络恶意攻击越来越频繁,网络安全问题已经引起了世界各国研究者的广泛关注。入侵检测方法作为防火墙后的第二道安全防护策略,是一种灵活有效的主动防御方法,它能实时的监测系统中的异常情况,当发现系统中存在恶意攻击或者对计算机设备的非法操作时,能及时发出报警信息,是对防火墙的有效补充。With the gradual improvement of the degree of network informatization, network malicious attacks are becoming more and more frequent, and network security issues have attracted extensive attention from researchers all over the world. As the second security protection strategy behind the firewall, the intrusion detection method is a flexible and effective active defense method. It can monitor abnormal conditions in the system in real time. When malicious attacks or illegal operations on computer equipment are found in the system , can send out alarm information in time, is an effective supplement to the firewall.

近年来,核极限学习机因为具有结构简单、迭代次数少和运行速度较快等优点,被广泛应用于入侵检测方法中。但是,如果没有恰当的选择核极限学习机中的参数,会使得核极限学习机的分类效果大大降低。智能优化算法是通过模拟自然现象或者生物行为来对最优化问题进行求解,是一种较好的优化方法。In recent years, kernel extreme learning machines have been widely used in intrusion detection methods because of their simple structure, fewer iterations and faster running speed. However, if the parameters in the kernel extreme learning machine are not properly selected, the classification effect of the kernel extreme learning machine will be greatly reduced. The intelligent optimization algorithm solves the optimization problem by simulating natural phenomena or biological behavior, and is a better optimization method.

目前主流的智能优化算法主要包括:一、基于单种智能优化算法的入侵检测方法,其优化方法通常采用单种智能优化方法来优化核极限学习机中的参数,比如差分进化方法、人工蜂群算法和禁忌搜索算法等;二、基于多种智能优化算法的入侵检测方法,其优化方法通常将多种智能优化算法结合起来共同进行寻优工作。The current mainstream intelligent optimization algorithms mainly include: 1. Intrusion detection methods based on a single intelligent optimization algorithm, the optimization method usually adopts a single intelligent optimization method to optimize the parameters in the kernel extreme learning machine, such as differential evolution method, artificial bee colony Algorithms and tabu search algorithms, etc.; 2. Intrusion detection methods based on multiple intelligent optimization algorithms. The optimization methods usually combine multiple intelligent optimization algorithms for optimization work.

然而,上述现有的智能优化算法均具有一些不可忽略的缺陷:首先,基于单种智能优化算法的入侵检测方法而言,其优化方法往往存在收敛速度慢、容易陷入局部最优陷阱和全局搜索能力不强的问题;第二,对于基于多种智能优化算法的入侵检测方法而言,其优化方法通常只结合标准智能优化算法,不能很有效的解决算法迭代效率低、计算精度差等问题;第三,对于基于多种智能优化算法的入侵检测方法而言,其优化方法中的初始种群往往采用随机的方法进行生成,通常存在种群分布质量较差、收敛速率差等问题。However, the above-mentioned existing intelligent optimization algorithms all have some shortcomings that cannot be ignored: First, for intrusion detection methods based on a single intelligent optimization algorithm, the optimization methods often have slow convergence speed, easy to fall into the trap of local optimality and global search. Second, for intrusion detection methods based on multiple intelligent optimization algorithms, the optimization methods usually only combine standard intelligent optimization algorithms, and cannot effectively solve the problems of low algorithm iteration efficiency and poor calculation accuracy; Third, for intrusion detection methods based on multiple intelligent optimization algorithms, the initial population in the optimization method is often generated by random methods, and there are usually problems such as poor population distribution quality and poor convergence rate.

发明内容SUMMARY OF THE INVENTION

针对现有技术的以上缺陷或改进需求,本发明提供了一种基于改进智能优化算法的入侵检测方法和系统,其目的在于,解决现有基于单种智能优化算法的入侵检测方法存在的收敛速度慢、容易陷入局部最优陷阱、以及全局搜索能力不强的技术问题;以及现有基于多种智能优化算法的入侵检测方法存在的算法迭代效率低、计算精度差的技术问题,以及种群分布质量较差、收敛速率差的技术问题。In view of the above defects or improvement requirements of the prior art, the present invention provides an intrusion detection method and system based on an improved intelligent optimization algorithm, the purpose of which is to solve the convergence speed of the existing intrusion detection method based on a single intelligent optimization algorithm. It is slow, easy to fall into the local optimal trap, and the technical problems of the global search ability are not strong; and the existing intrusion detection methods based on a variety of intelligent optimization algorithms have the technical problems of low algorithm iteration efficiency, poor calculation accuracy, and the quality of population distribution. Poor technical problems with poor convergence rate.

为实现上述目的,按照本发明的一个方面,提供了一种基于改进智能优化算法的入侵检测方法,包括以下步骤:In order to achieve the above object, according to one aspect of the present invention, an intrusion detection method based on an improved intelligent optimization algorithm is provided, comprising the following steps:

(1)获取数据集,使用z-score方法对数据集进行标准化处理,以得到标准化处理后的数据集;(1) Obtain a data set, and use the z-score method to standardize the data set to obtain a standardized data set;

(2)通过改进智能优化算法优化核极限学习机模型的惩罚系数C和核系数γ,并得到优化后的核极限学习机模型;(2) Optimize the penalty coefficient C and the kernel coefficient γ of the kernel extreme learning machine model by improving the intelligent optimization algorithm, and obtain the optimized kernel extreme learning machine model;

(3)对步骤(2)优化后的核极限学习机模型进行训练,以得到训练好的核极限学习机模型,并使用训练好的核极限学习机对数据集进行分类,以得到分类结果。(3) Train the kernel extreme learning machine model optimized in step (2) to obtain a trained kernel extreme learning machine model, and use the trained kernel extreme learning machine to classify the data set to obtain a classification result.

优选地,步骤(1)包括以下子步骤:Preferably, step (1) includes the following substeps:

(1-1)获取数据集Ds;(1-1) Obtain the dataset Ds;

Figure BDA0003032371950000031
Figure BDA0003032371950000031

其中,k为数据集Ds中的样本总数,n为数据集中样本的特征维数,

Figure BDA0003032371950000032
为Ds中第i行第j个样本点,其表示数据集Ds中第i个样本中的第j个特征属性值,且有i∈[1,k],j∈[1,n];Among them, k is the total number of samples in the data set Ds, n is the feature dimension of the samples in the data set,
Figure BDA0003032371950000032
is the jth sample point in the ith row in Ds, which represents the jth feature attribute value in the ith sample in the data set Ds, and has i∈[1,k], j∈[1,n];

(1-2)从步骤(1-1)得到的数据集Ds中获取第i行第j个元素

Figure BDA0003032371950000033
并对其进行标准化处理,以得到标准化后的特征属性值
Figure BDA0003032371950000034
(1-2) Obtain the jth element of the i-th row from the data set Ds obtained in step (1-1)
Figure BDA0003032371950000033
And normalize it to get the normalized feature attribute value
Figure BDA0003032371950000034

(1-3)针对数据集Ds中的剩余样本点,重复上述步骤(1-2),直到数据集Ds中的所有样本点都被处理完毕为止,从而得到标准化后的数据集Ds。(1-3) For the remaining sample points in the data set Ds, repeat the above step (1-2) until all the sample points in the data set Ds have been processed, thereby obtaining the standardized data set Ds.

优选地,步骤(1-2)中的标准化处理的计算公式如下:Preferably, the calculation formula of the standardized processing in step (1-2) is as follows:

Figure BDA0003032371950000035
Figure BDA0003032371950000035

其中,μj是数据集Ds中第j列的均值,σj是数据集Ds中第j列的标准差。where μj is the mean of the jth column in the dataset Ds, and σj is the standard deviation of the jth column in the dataset Ds.

优选地,步骤(2)具体包括以下子步骤:Preferably, step (2) specifically includes the following substeps:

(2-1)随机生成种群规模为N的初始种群pop={p1,p2,…,pN},并设置计数器cnt=1,其中种群中第m个个体为pm={Cmm},m∈[1,N],Cm和γm分别表示第m个个体的惩罚系数和核系数;(2-1) Randomly generate an initial population pop={p 1 ,p 2 ,...,p N } with a population size of N, and set the counter cnt=1, where the mth individual in the population is p m ={C mm }, m∈[1,N], C m and γ m represent the penalty coefficient and kernel coefficient of the mth individual, respectively;

(2-2)判断cnt是否大于种群规模N,如果是,则转入步骤(2-4),否则转入步骤(2-3);(2-2) Judging whether cnt is greater than the population size N, if so, go to step (2-4), otherwise go to step (2-3);

(2-3)判断cnt是否为1,如果是,则随机生成位于(0,1)范围内、且不能等于0.25、0.5和0.75的混沌数α(1),设置计数器cnt=cnt+1,并返回步骤(2-2),否则生成第cnt个混沌数α(cnt),设置计数器cnt=cnt+1,并返回步骤(2-2);(2-3) Determine whether cnt is 1. If so, randomly generate a chaotic number α(1) that is in the range of (0,1) and cannot be equal to 0.25, 0.5 and 0.75, and set the counter cnt=cnt+1, And return to step (2-2), otherwise generate the cnt th chaotic number α(cnt), set the counter cnt=cnt+1, and return to step (2-2);

(2-4)设置计数器cnt1=1;(2-4) Set the counter cnt1=1;

(2-5)判断cnt1是否大于种群规模N,如果是,则转入步骤(2-7),否则转入步骤(2-6);(2-5) Judging whether cnt1 is greater than the population size N, if so, go to step (2-7), otherwise go to step (2-6);

(2-6)生成第cnt1个混沌个体

Figure BDA0003032371950000041
设置计数器cnt1=cnt1+1,并返回步骤(2-5);(2-6) Generate the cnt1 chaotic individual
Figure BDA0003032371950000041
Set the counter cnt1=cnt1+1, and return to step (2-5);

(2-7)将生成的N个混沌个体与步骤(2-1)中生成的初始种群混合,以得到混合种群mixpop={mix1,mix2,…,mix2N},获取该混合种群中所有个体的适应度值所构成的适应度值集合F={f(mix1),f(mix2),…,f(mixsn)},按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合

Figure BDA0003032371950000042
并取新的适应度值集合中前N个个体作为混沌初始化后的种群,取新的适应度值集合中最小适应度值对应的个体作为全局最优解pbest,并设置计数器cnt2=1,其中sn为适应度值集合F中适应度值的总数;(2-7) Mix the generated N chaotic individuals with the initial population generated in step (2-1) to obtain a mixed population mixpop={mix 1 , mix 2 ,..., mix 2N }, and obtain the The fitness value set F={f(mix 1 ),f(mix 2 ),...,f(mix sn )} formed by the fitness values of all individuals, in this fitness value set in the order from small to large to sort all fitness values of , to obtain a new set of fitness values
Figure BDA0003032371950000042
And take the first N individuals in the new fitness value set as the population after chaotic initialization, take the individual corresponding to the minimum fitness value in the new fitness value set as the global optimal solution p best , and set the counter cnt2=1, where sn is the total number of fitness values in the fitness value set F;

(2-8)判断cnt2是否等于最大迭代次数T,如果是,则输出全局最优解pbest={Cbestbest},过程结束,否则转入步骤(2-9);(2-8) Judging whether cnt2 is equal to the maximum number of iterations T, if so, output the global optimal solution p best ={C bestbest }, the process ends, otherwise go to step (2-9);

(2-9)判断cnt2是否为1,如果是,则将步骤(2-7)中得到的混沌初始化后的种群作为种群popmix,并从种群popmix中随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后转入步骤(2-10),否则进入步骤(2-33);(2-9) Determine whether cnt2 is 1, if so, take the chaotically initialized population obtained in step (2-7) as the population pop mix , and randomly select q population individuals from the population pop mix to form the population pop de , the remaining population individuals form population pop abc , and then go to step (2-10), otherwise go to step (2-33);

(2-10)针对步骤(2-9)得到的种群popde,获取该种群中所有个体的适应度值所构成的适应度值集合

Figure BDA0003032371950000043
取该适应度值集合中适应度最小的个体作为改进差分进化算法中的局部最优解
Figure BDA0003032371950000044
并设置计数器cnt3=1;(2-10) For the population pop de obtained in step (2-9), obtain a fitness value set composed of fitness values of all individuals in the population
Figure BDA0003032371950000043
Take the individual with the smallest fitness in the fitness value set as the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000044
And set the counter cnt3=1;

(2-11)判断cnt3是否等于最大子种群迭代次数I,如果是,则保存改进差分进化算法中的局部最优解

Figure BDA0003032371950000051
和种群popde,并转入步骤(2-18),否则转入步骤(2-12);(2-11) Determine whether cnt3 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000051
and population pop de , and go to step (2-18), otherwise go to step (2-12);

(2-12)判断cnt3是否为1,如果是,则获取步骤(2-10)得到的种群popde中所有个体的适应度值所构成的适应度值集合Fde,并转入步骤(2-13),否则进入步骤(2-17);(2-12) Determine whether cnt3 is 1, and if so, obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de obtained in step (2-10), and go to step (2) -13), otherwise go to step (2-17);

(2-13)针对步骤(2-12)得到的适应度值集合Fde,按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合

Figure BDA0003032371950000052
Figure BDA0003032371950000053
中最小适应度值对应的个体作为改进差分进化算法中的局部最优解
Figure BDA0003032371950000054
并取适应度值排前一半的种群个体组成集合
Figure BDA0003032371950000055
该适应度值集合
Figure BDA0003032371950000056
中剩余的个体组成集合
Figure BDA0003032371950000057
(2-13) For the fitness value set F de obtained in step (2-12), sort all fitness values in the fitness value set according to the order from small to large to obtain a new fitness value set
Figure BDA0003032371950000052
Pick
Figure BDA0003032371950000053
The individual corresponding to the minimum fitness value is used as the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000054
And take the top half of the population individuals with fitness value to form a set
Figure BDA0003032371950000055
The fitness value set
Figure BDA0003032371950000056
The remaining individuals form the set
Figure BDA0003032371950000057

(2-14)根据步骤(2-13)中得到的集合Fde中的第

Figure BDA0003032371950000058
个个体
Figure BDA0003032371950000059
生成自适应变异个体
Figure BDA00030323719500000510
其中
Figure BDA00030323719500000511
(2-14) According to the first in the set F de obtained in step (2-13)
Figure BDA0003032371950000058
individual
Figure BDA0003032371950000059
Generate adaptive mutant individuals
Figure BDA00030323719500000510
in
Figure BDA00030323719500000511

(2-15)对步骤(2-14)得到的自适应变异个体

Figure BDA00030323719500000512
和步骤(2-13)中得到的集合Fde中的第
Figure BDA00030323719500000513
个个体
Figure BDA00030323719500000514
行交叉操作,以生成实验个体
Figure BDA00030323719500000515
(2-15) For the adaptive mutant individual obtained in step (2-14)
Figure BDA00030323719500000512
and the first in the set F de obtained in step (2-13)
Figure BDA00030323719500000513
individual
Figure BDA00030323719500000514
Crossover operation to generate experimental individuals
Figure BDA00030323719500000515

(2-16)获取步骤(2-15)得到的实验个体

Figure BDA00030323719500000516
对应的适应度值以及步骤(2-13)得到的个体
Figure BDA00030323719500000517
对应的适应度值,使用二者中较小的适应度值所对应的个体代替适应度值集合Fde中的对应个体,从而得到更新后的种群popde,设置计数器cnt3=cnt3+1,并返回步骤(2-11);(2-16) Obtain the experimental individuals obtained in the step (2-15)
Figure BDA00030323719500000516
The corresponding fitness value and the individual obtained in step (2-13)
Figure BDA00030323719500000517
For the corresponding fitness value, use the individual corresponding to the smaller fitness value of the two to replace the corresponding individual in the fitness value set F de , so as to obtain the updated population pop de , set the counter cnt3=cnt3+1, and Return to step (2-11);

(2-17)获取步骤(2-16)更新后的种群popde中所有个体的适应度值所构成的适应度值集合Fde,然后返回步骤(2-13);(2-17) Obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de updated in step (2-16), and then return to step (2-13);

(2-18)针对步骤(2-9)中的种群popabc,获取该种群中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合

Figure BDA0003032371950000061
其中N-q为人工蜂群适应度值集合Fitabc中人工蜂群适应度值的总数,初始化禁忌表T1为种群popabc,禁忌表T2为空,并取人工蜂群适应度值集合Fitabc中人工蜂群适应度最小的个体作为改进人工蜂群算法中的局部最优解
Figure BDA0003032371950000062
并设置计数器cnt4=1;(2-18) For the population pop abc in step (2-9), obtain an artificial bee colony fitness value set composed of the artificial bee colony fitness values of all individuals in the population
Figure BDA0003032371950000061
Among them, Nq is the total number of artificial bee colony fitness values in the artificial bee colony fitness value set Fit abc , the initial taboo table T1 is the population pop abc , the taboo table T2 is empty, and the artificial bee colony fitness value set Fit abc is taken from the artificial bee colony fitness value set Fit abc. Individuals with the smallest swarm fitness as a local optimal solution in an improved artificial bee colony algorithm
Figure BDA0003032371950000062
And set the counter cnt4=1;

(2-19)判断cnt4是否等于最大子种群迭代次数I,如果是,则保存改进人工蜂群算法中的局部最优解

Figure BDA0003032371950000063
和种群popabc,转入步骤(2-32),否则转入步骤(2-20);(2-19) Determine whether cnt4 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved artificial bee colony algorithm
Figure BDA0003032371950000063
and population pop abc , go to step (2-32), otherwise go to step (2-20);

(2-20)判断cnt4是否为1,如果是,则获取步骤(2-18)中的种群popabc中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合Fitabc,转入步骤(2-21),否则进入步骤(2-31);(2-20) Determine whether cnt4 is 1, and if so, obtain the artificial bee colony fitness value set Fit abc composed of the artificial bee colony fitness values of all individuals in the population pop abc in step (2-18), Go to step (2-21), otherwise go to step (2-31);

(2-21)根据步骤(2-20)中得到的集合Fitabc中的第

Figure BDA0003032371950000064
个蜜源个体
Figure BDA0003032371950000065
生成领域蜜源个体
Figure BDA0003032371950000066
其中
Figure BDA0003032371950000067
(2-21) According to the No. 1 in the set Fit abc obtained in step (2-20)
Figure BDA0003032371950000064
nectar source
Figure BDA0003032371950000065
Generate Domain Nectar Individuals
Figure BDA0003032371950000066
in
Figure BDA0003032371950000067

(2-22)根据步骤(2-21)中得到的领域蜜源个体

Figure BDA0003032371950000068
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-21),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-23);(2-22) According to the field nectar source individuals obtained in step (2-21)
Figure BDA0003032371950000068
Determine whether the nectar source individuals in this field are in the taboo table T1 or T2, if so, go to step (2-21), otherwise, add the nectar source individuals in this field to the taboo table T1, and enter step (2-23);

(2-23)获取步骤(2-21)的蜜源个体

Figure BDA0003032371950000069
对应的人工蜂群适应度值
Figure BDA00030323719500000610
以及领域蜜源个体
Figure BDA00030323719500000611
对应的人工蜂群适应度值
Figure BDA00030323719500000612
判断
Figure BDA00030323719500000613
是否小于
Figure BDA00030323719500000614
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;(2-23) Obtain the nectar source individuals of step (2-21)
Figure BDA0003032371950000069
Corresponding artificial bee colony fitness value
Figure BDA00030323719500000610
and domain nectar individuals
Figure BDA00030323719500000611
Corresponding artificial bee colony fitness value
Figure BDA00030323719500000612
judge
Figure BDA00030323719500000613
Is it less than
Figure BDA00030323719500000614
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;

(2-24)计算通过步骤(2-23)中得到的更新后蜜源种群中的第

Figure BDA00030323719500000615
个蜜源个体的概率
Figure BDA00030323719500000616
并产生一个[0,1]范围的随机数,判断该随机数是否小于
Figure BDA00030323719500000617
如果是,则进入步骤(2-25),否则,进入步骤(2-28);(2-24) Calculate the No. 1 nectar population in the updated nectar population obtained in step (2-23)
Figure BDA00030323719500000615
The probability of a nectar source
Figure BDA00030323719500000616
And generate a random number in the range of [0,1] to determine whether the random number is less than
Figure BDA00030323719500000617
If yes, then go to step (2-25), otherwise, go to step (2-28);

(2-25)根据步骤(2-24)得到的蜜源个体

Figure BDA00030323719500000618
生成领域蜜源个体
Figure BDA00030323719500000619
其中
Figure BDA0003032371950000071
(2-25) The nectar source individual obtained according to step (2-24)
Figure BDA00030323719500000618
Generate Domain Nectar Individuals
Figure BDA00030323719500000619
in
Figure BDA0003032371950000071

(2-26)根据步骤(2-25)中得到的领域蜜源个体

Figure BDA0003032371950000072
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-25),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-27);(2-26) According to the field nectar source individual obtained in step (2-25)
Figure BDA0003032371950000072
Determine whether the nectar source individual in this field is in the taboo table T1 or T2, if so, go to step (2-25), otherwise, add the nectar source individual in this field to the taboo table T1, and enter step (2-27);

(2-27)获取步骤(2-24)的蜜源个体

Figure BDA0003032371950000073
对应的人工蜂群适应度值
Figure BDA0003032371950000074
以及步骤(2-25)的领域蜜源个体
Figure BDA0003032371950000075
对应的人工蜂群适应度值
Figure BDA0003032371950000076
判断
Figure BDA0003032371950000077
是否小于
Figure BDA0003032371950000078
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;(2-27) Obtain the nectar source individuals of step (2-24)
Figure BDA0003032371950000073
Corresponding artificial bee colony fitness value
Figure BDA0003032371950000074
And the domain nectar individual of step (2-25)
Figure BDA0003032371950000075
Corresponding artificial bee colony fitness value
Figure BDA0003032371950000076
judge
Figure BDA0003032371950000077
Is it less than
Figure BDA0003032371950000078
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;

(2-28)获取步骤(2-27)中Tr的最大未更新次数max,判断max是否大于蜜源最大搜索次数limit,如果是,将max对应的蜜源个体加入到T2中,并转到步骤(2-29),否则转到步骤(2-31);(2-28) Obtain the maximum number of unupdated times max of Tr in step (2-27), and determine whether max is greater than the maximum search times limit of the nectar source. If so, add the nectar source individual corresponding to max to T2, and go to step ( 2-29), otherwise go to step (2-31);

(2-29)随机生成一个新的蜜源个体;(2-29) Randomly generate a new nectar source;

(2-30)判断步骤(2-29)中的蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-29),否则,将该蜜源个体加入禁忌表T1中,并获取更新后的种群popabc,并转到步骤(2-31),设置计数器cnt4=cnt4+1,并返回步骤(2-19);(2-30) Determine whether the nectar source individual in step (2-29) is in the taboo table T1 or T2, if so, go to step (2-29), otherwise, add the nectar source individual to the taboo table T1, and obtain The updated population pop abc , and go to step (2-31), set the counter cnt4=cnt4+1, and return to step (2-19);

(2-31)获取步骤(2-30)更新后的种群popabc中所有个体的适应度值所构成的适应度值集合Fitabc,然后返回步骤(2-20);(2-31) Obtain the fitness value set Fit abc formed by the fitness values of all individuals in the population pop abc updated in step (2-30), and then return to step (2-20);

(2-32)获取步骤(2-11)的局部最优解

Figure BDA0003032371950000079
对应的适应度值
Figure BDA00030323719500000710
以及步骤(2-19)的局部最优解
Figure BDA00030323719500000711
对应的适应度值
Figure BDA00030323719500000712
使用二者中较小的适应度值对应的个体来代替pbest,并将popde和popabc融合得到更新后的种群popmix,设置计数器cnt2=cnt2+1,并返回步骤(2-8);(2-32) Obtain the local optimal solution of step (2-11)
Figure BDA0003032371950000079
The corresponding fitness value
Figure BDA00030323719500000710
and the local optimal solution of step (2-19)
Figure BDA00030323719500000711
The corresponding fitness value
Figure BDA00030323719500000712
Use the individual corresponding to the smaller fitness value of the two to replace p best , and fuse pop de and pop abc to obtain the updated population pop mix , set the counter cnt2=cnt2+1, and return to step (2-8) ;

(2-33)获取步骤(2-32)更新后的种群popmix,并随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后返回步骤(2-10)。(2-33) Obtain the updated population pop mix in step (2-32), randomly select q population individuals to form population pop de , and the remaining population individuals form population pop abc , and then return to step (2-10).

优选地,步骤(2-3)中生成混沌数的计算公式如下:Preferably, the calculation formula for generating the chaotic number in step (2-3) is as follows:

α(cnt)=μ·α(cnt)·(1-α(cnt-1))α(cnt)=μ·α(cnt)·(1-α(cnt-1))

其中,μ是相关系数,其取值范围是0到4,优选为4。Among them, μ is the correlation coefficient, and its value ranges from 0 to 4, preferably 4.

步骤(2-6)中生成第cnt1个混沌个体

Figure BDA0003032371950000081
的计算公式如下:Generate the cnt1 chaotic individual in step (2-6)
Figure BDA0003032371950000081
The calculation formula is as follows:

Figure BDA0003032371950000082
Figure BDA0003032371950000082

其中,pcnt1是第cnt1个初始种群个体,α(cnt1)是第cnt1个混沌数。Among them, p cnt1 is the cnt1-th initial population individual, and α(cnt1) is the cnt1-th chaotic number.

步骤(2-7)是从步骤(1)中的数据集中随机选取CN组训练数据,计算其分类错误率CE作为适应度函数f,其中分类错误率CE计算公式如下:Step (2-7) is to randomly select the CN group training data from the data set in step (1), and calculate its classification error rate CE as the fitness function f, wherein the calculation formula of the classification error rate CE is as follows:

Figure BDA0003032371950000083
Figure BDA0003032371950000083

其中,EN为分类错误的样本数,CN为训练数据样本数。Among them, EN is the number of misclassified samples, and CN is the number of training data samples.

优选地,步骤(2-14)中生成自适应变异个体的计算公式如下:Preferably, the calculation formula for generating the adaptive mutation individual in step (2-14) is as follows:

Figure BDA0003032371950000084
Figure BDA0003032371950000084

其中,

Figure BDA0003032371950000085
两者彼此不相同,且两者均不等于
Figure BDA0003032371950000086
Fc为自适应变异因子;in,
Figure BDA0003032371950000085
Both are not identical to each other, and neither is equal to
Figure BDA0003032371950000086
F c is the adaptive variation factor;

自适应变异因子Fc的计算公式如下:The formula for calculating the adaptive variation factor F c is as follows:

Figure BDA0003032371950000087
Figure BDA0003032371950000087

其中,fc是初始变异因子;where f c is the initial variation factor;

步骤(2-15)中生成实验个体的计算公式如下:The calculation formula for generating experimental individuals in step (2-15) is as follows:

Figure BDA0003032371950000088
Figure BDA0003032371950000088

其中,randn是随机产生于[1,D]之间的随机整数,rand是属于[0,1]之间的均匀分布的随机实数,CR是交叉因子,D为个体基因维度,其中h∈[1,D];Among them, randn is a random integer randomly generated between [1, D], rand is a random real number belonging to a uniform distribution between [0, 1], CR is the crossover factor, D is the individual gene dimension, where h∈[ 1, D];

步骤(2-18)中的人工蜂群适应度函数是采用以下公式:The artificial bee colony fitness function in step (2-18) adopts the following formula:

Figure BDA0003032371950000091
Figure BDA0003032371950000091

其中f表示适应度函数,abs表示绝对值函数。where f is the fitness function and abs is the absolute value function.

优选地,步骤(2-21)中生成领域蜜源个体的计算公式如下:Preferably, in step (2-21), the calculation formula for generating domain nectar source individuals is as follows:

Figure BDA0003032371950000092
Figure BDA0003032371950000092

其中

Figure BDA0003032371950000093
且与
Figure BDA0003032371950000094
不相同,φ为邻域搜索因子,是-1到1的一个随机数。in
Figure BDA0003032371950000093
and with
Figure BDA0003032371950000094
Not the same, φ is the neighborhood search factor, which is a random number from -1 to 1.

步骤(2-24)中生成概率的计算公式如下:The calculation formula of the generation probability in step (2-24) is as follows:

Figure BDA0003032371950000095
Figure BDA0003032371950000095

优选地,步骤(3)具体包括以下子步骤:Preferably, step (3) specifically includes the following substeps:

(3-1)将步骤(1)标准化处理后的数据集按照7:3的比例分为训练集和测试集;(3-1) Divide the standardized data set in step (1) into a training set and a test set according to a ratio of 7:3;

(3-2)根据步骤(2)中得到的最优核参数γbest获取高斯核函数K(xki,xkj),并根据高斯核函数K(xki,xkj)和步骤(3-1)中得到的训练集获得训练好的核极限学习机模型;(3-2) Obtain the Gaussian kernel function K(x ki , x kj ) according to the optimal kernel parameter γ best obtained in step (2), and according to the Gaussian kernel function K(x ki , x kj ) and step (3- The training set obtained in 1) obtains a trained kernel extreme learning machine model;

(3-3)使用步骤(3-2)中训练好的核极限学习机模型对步骤(3-1)中的测试集进行分类,以得到分类结果。(3-3) Use the kernel extreme learning machine model trained in step (3-2) to classify the test set in step (3-1) to obtain a classification result.

优选地,步骤(3-2)中,使用最优核参数γbest获取高斯核函数K(xki,xkj)这一过程具体是:Preferably, in step (3-2), the process of using the optimal kernel parameter γ best to obtain the Gaussian kernel function K(x ki , x kj ) is as follows:

K(xki,xkj)=exp(-||xki-xkj||2best)K(x ki ,x kj )=exp(-||x ki -x kj || 2best )

核极限学习机模型的训练公式如下:The training formula of the kernel extreme learning machine model is as follows:

Figure BDA0003032371950000096
Figure BDA0003032371950000096

其中f(x)是核极限学习机的输出函数,KN是训练集的总数,ΩKELM是高斯核函数对应的核矩阵,T为训练集的标签,Cbest是根据步骤(2)中得到的最优惩罚系数。where f(x) is the output function of the kernel extreme learning machine, KN is the total number of training sets, Ω KELM is the kernel matrix corresponding to the Gaussian kernel function, T is the label of the training set, and C best is obtained according to step (2) optimal penalty coefficient.

按照本发明的另一方面,提供了一种基于改进智能优化算法的入侵检测系统,包括:According to another aspect of the present invention, an intrusion detection system based on an improved intelligent optimization algorithm is provided, comprising:

第一模块,用于获取数据集,使用z-score方法对数据集进行标准化处理,以得到标准化处理后的数据集;The first module is used to obtain the data set, and use the z-score method to standardize the data set to obtain the standardized data set;

第二模块,用于通过改进智能优化算法优化核极限学习机模型的惩罚系数C和核系数γ,并得到优化后的核极限学习机模型;The second module is used to optimize the penalty coefficient C and the kernel coefficient γ of the kernel extreme learning machine model by improving the intelligent optimization algorithm, and obtain the optimized kernel extreme learning machine model;

第三模块,用于对第二模块优化后的核极限学习机模型进行训练,以得到训练好的核极限学习机模型,并使用训练好的核极限学习机对数据集进行分类,以得到分类结果。The third module is used to train the kernel extreme learning machine model optimized by the second module to obtain the trained kernel extreme learning machine model, and use the trained kernel extreme learning machine to classify the data set to obtain the classification result.

总体而言,通过本发明所构思的以上技术方案与现有技术相比,能够取得下列有益效果:In general, compared with the prior art, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

(1)由于本发明采用了步骤(2-1)到步骤(2-7),其采用混沌初始化策略来初始化种群,因此能解决现有基于多种智能优化算法的入侵检测方法中种群质量分布较差和不能得到质量较高的最优解的技术问题;(1) Since the present invention adopts steps (2-1) to (2-7), it adopts the chaotic initialization strategy to initialize the population, so it can solve the problem of population quality distribution in the existing intrusion detection methods based on multiple intelligent optimization algorithms Technical problems that are poor and cannot obtain high-quality optimal solutions;

(2)由于本发明采用了步骤(2-14)和步骤(2-18),其引入自适应变异因子和精英进化策略对差分进化算法进行改进,同时采用禁忌搜索算法对人工蜂群算法进行优化,因此能够解决现有基于单种智能优化算法的入侵检测方法中存在的收敛速度慢、计算精度低、容易陷入局部最优陷阱和全局搜索能力不强的技术问题;(2) Since the present invention adopts steps (2-14) and (2-18), it introduces adaptive mutation factor and elite evolution strategy to improve the differential evolution algorithm, and at the same time adopts the tabu search algorithm to perform artificial bee colony algorithm. Therefore, the existing intrusion detection methods based on a single intelligent optimization algorithm can solve the technical problems of slow convergence speed, low calculation accuracy, easy to fall into the trap of local optimum and weak global search ability;

(3)由于本发明采用了步骤(2-32),其采用改进的差分进化算法和改进的人工蜂群算法作为基本优化算法来进行结合,因此能解决现有基于多种智能优化算法的入侵检测方法中运行效率较低和算法性能不佳的技术问题。(3) Since the present invention adopts step (2-32), it adopts the improved differential evolution algorithm and the improved artificial bee colony algorithm as the basic optimization algorithm to combine, so it can solve the existing intrusion based on a variety of intelligent optimization algorithms. Technical issues with low operational efficiency and poor algorithm performance in detection methods.

附图说明Description of drawings

图1是本发明基于改进智能优化算法的入侵检测方法流程图。Fig. 1 is a flow chart of the intrusion detection method based on the improved intelligent optimization algorithm of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

本发明的基本思路在于,提出了一种基于改进智能优化算法的入侵检测方法,其方法首先针对差分进化算法容易陷入局部最优陷阱的问题,引入自适应变异因子,使差分进化算法跳出局部最优值,并提高差分进化算法的全局搜索能力,同时采用精英进化策略来提升差分进化算法的搜索速率,加快算法收敛速度。然后针对人工蜂群算法容易陷入早熟、全局搜索能力较差的问题,采用禁忌搜索算法优秀的全局搜索能力来优化人工蜂群算法中的领域搜索能力,同时改善人工蜂群算法的运行效率。最后,将上述两种改进算法作为基本优化算法进行结合,同时引入混沌初始化策略来初始化种群,得到一种改进智能优化算法,并将该改进智能优化算法应用到入侵检测方法的参数寻优中,提高了入侵检测方法的分类准确性和稳定性。本方法相对于其他基于智能优化算法的入侵检测算法,容易跳出局部最优,能有效避免算法早熟,同时具有运行效率和计算精度好、迭代效率高和收率速度快等优点。The basic idea of the present invention is to propose an intrusion detection method based on an improved intelligent optimization algorithm. The method firstly aims at the problem that the differential evolution algorithm is prone to fall into the local optimum trap, and introduces an adaptive mutation factor to make the differential evolution algorithm jump out of the local optimum. The figure of merit is improved, and the global search ability of the differential evolution algorithm is improved. At the same time, the elite evolution strategy is used to improve the search rate of the differential evolution algorithm and accelerate the convergence speed of the algorithm. Then, in view of the problem that artificial bee colony algorithm is prone to fall into premature and poor global search ability, the excellent global search ability of tabu search algorithm is used to optimize the domain search ability in artificial bee colony algorithm, and at the same time improve the operation efficiency of artificial bee colony algorithm. Finally, the above two improved algorithms are combined as the basic optimization algorithm, and the chaotic initialization strategy is introduced to initialize the population, and an improved intelligent optimization algorithm is obtained, and the improved intelligent optimization algorithm is applied to the parameter optimization of the intrusion detection method. The classification accuracy and stability of the intrusion detection method are improved. Compared with other intrusion detection algorithms based on intelligent optimization algorithms, this method is easy to jump out of the local optimum, and can effectively avoid the premature algorithm.

如图1所示,本发明提供了一种基于改进智能优化算法的入侵检测方法,包括以下步骤:As shown in Figure 1, the present invention provides an intrusion detection method based on an improved intelligent optimization algorithm, comprising the following steps:

(1)获取数据集,使用z-score方法对数据集进行标准化处理,以得到标准化处理后的数据集;(1) Obtain a data set, and use the z-score method to standardize the data set to obtain a standardized data set;

本步骤具体包括以下子步骤:This step specifically includes the following sub-steps:

(1-1)获取数据集Ds;(1-1) Obtain the dataset Ds;

Figure BDA0003032371950000121
Figure BDA0003032371950000121

其中,k为数据集Ds中的样本总数,n为数据集中样本的特征维数,

Figure BDA0003032371950000122
为Ds中第i行第j个样本点,其表示数据集Ds中第i个样本中的第j个特征属性值,且有i∈[1,k],j∈[1,n];Among them, k is the total number of samples in the data set Ds, n is the feature dimension of the samples in the data set,
Figure BDA0003032371950000122
is the jth sample point in the ith row in Ds, which represents the jth feature attribute value in the ith sample in the data set Ds, and has i∈[1,k], j∈[1,n];

(1-2)从步骤(1-1)得到的数据集Ds中获取第i行第j个元素(即第i个样本中的第j个特征属性值)

Figure BDA0003032371950000123
并对其进行标准化处理,以得到标准化后的特征属性值
Figure BDA0003032371950000124
(1-2) Obtain the j-th element of the i-th row (that is, the j-th feature attribute value in the i-th sample) from the data set Ds obtained in step (1-1)
Figure BDA0003032371950000123
And normalize it to get the normalized feature attribute value
Figure BDA0003032371950000124

上述标准化处理的计算公式如下:The calculation formula of the above normalization processing is as follows:

Figure BDA0003032371950000125
Figure BDA0003032371950000125

其中,μj是数据集Ds中第j列的均值,σj是数据集Ds中第j列的标准差;Among them, μ j is the mean of the jth column in the data set Ds, and σ j is the standard deviation of the jth column in the data set Ds;

(1-3)针对数据集Ds中的剩余样本点,重复上述步骤(1-2),直到数据集Ds中的所有样本点都被处理完毕为止,从而得到标准化后的数据集Ds;(1-3) For the remaining sample points in the data set Ds, repeat the above step (1-2) until all the sample points in the data set Ds have been processed, thereby obtaining the standardized data set Ds;

(2)通过改进智能优化算法优化核极限学习机模型的惩罚系数C和核系数γ,并得到优化后的核极限学习机模型;(2) Optimize the penalty coefficient C and the kernel coefficient γ of the kernel extreme learning machine model by improving the intelligent optimization algorithm, and obtain the optimized kernel extreme learning machine model;

本步骤具体包括以下子步骤:This step specifically includes the following sub-steps:

(2-1)随机生成种群规模为N的初始种群pop={p1,p2,…,pN},并设置计数器cnt=1,其中种群中第m个个体为pm={Cmm},m∈[1,N],Cm和γm分别表示第m个个体的惩罚系数和核系数;(2-1) Randomly generate an initial population pop={p 1 ,p 2 ,...,p N } with a population size of N, and set the counter cnt=1, where the mth individual in the population is p m ={C mm }, m∈[1,N], C m and γ m represent the penalty coefficient and kernel coefficient of the mth individual, respectively;

具体而言,种群规模N的取值范围是10到60,优选为20。Specifically, the population size N ranges from 10 to 60, preferably 20.

(2-2)判断cnt是否大于种群规模N,如果是,则转入步骤(2-4),否则转入步骤(2-3);(2-2) Judging whether cnt is greater than the population size N, if so, go to step (2-4), otherwise go to step (2-3);

(2-3)判断cnt是否为1,如果是,则随机生成位于(0,1)范围内、且不能等于0.25、0.5和0.75的混沌数α(1),设置计数器cnt=cnt+1,并返回步骤(2-2),否则生成第cnt个混沌数α(cnt),设置计数器cnt=cnt+1,并返回步骤(2-2);(2-3) Determine whether cnt is 1. If so, randomly generate a chaotic number α(1) that is in the range of (0,1) and cannot be equal to 0.25, 0.5 and 0.75, and set the counter cnt=cnt+1, And return to step (2-2), otherwise generate the cnt th chaotic number α(cnt), set the counter cnt=cnt+1, and return to step (2-2);

上述生成混沌数的计算公式如下:The calculation formula of the above generated chaotic number is as follows:

α(cnt)=μ·α(cnt)·(1-α(cnt-1))α(cnt)=μ·α(cnt)·(1-α(cnt-1))

其中,μ是相关系数,其取值范围是0到4,优选为4。Among them, μ is the correlation coefficient, and its value ranges from 0 to 4, preferably 4.

(2-4)设置计数器cnt1=1;(2-4) Set the counter cnt1=1;

(2-5)判断cnt1是否大于种群规模N,如果是,则转入步骤(2-7),否则转入步骤(2-6);(2-5) Judging whether cnt1 is greater than the population size N, if so, go to step (2-7), otherwise go to step (2-6);

(2-6)生成第cnt1个混沌个体

Figure BDA0003032371950000131
设置计数器cnt1=cnt1+1,并返回步骤(2-5);(2-6) Generate the cnt1 chaotic individual
Figure BDA0003032371950000131
Set the counter cnt1=cnt1+1, and return to step (2-5);

上述生成第cnt1个混沌个体

Figure BDA0003032371950000132
的计算公式如下:The above generates the cnt1th chaotic individual
Figure BDA0003032371950000132
The calculation formula is as follows:

Figure BDA0003032371950000133
Figure BDA0003032371950000133

其中,pcnt1是第cnt1个初始种群个体,α(cnt1)是第cnt1个混沌数。Among them, p cnt1 is the cnt1-th initial population individual, and α(cnt1) is the cnt1-th chaotic number.

(2-7)将生成的N个混沌个体与步骤(2-1)中生成的初始种群混合,以得到混合种群mixpop={mix1,mix2,…,mix2N},获取该混合种群中所有个体的适应度值所构成的适应度值集合F={f(mix1),f(mix2),…,f(mixsn)},按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合

Figure BDA0003032371950000134
并取新的适应度值集合中前N个个体作为混沌初始化后的种群,取新的适应度值集合中最小适应度值对应的个体作为全局最优解pbest,并设置计数器cnt2=1,其中sn为适应度值集合F中适应度值的总数;(2-7) Mix the generated N chaotic individuals with the initial population generated in step (2-1) to obtain a mixed population mixpop={mix 1 , mix 2 ,..., mix 2N }, and obtain the The fitness value set F={f(mix 1 ),f(mix 2 ),...,f(mix sn )} formed by the fitness values of all individuals, in this fitness value set in the order from small to large to sort all fitness values of , to obtain a new set of fitness values
Figure BDA0003032371950000134
And take the first N individuals in the new fitness value set as the population after chaotic initialization, take the individual corresponding to the minimum fitness value in the new fitness value set as the global optimal solution p best , and set the counter cnt2=1, where sn is the total number of fitness values in the fitness value set F;

具体而言,本步骤中是从步骤(1)中的数据集中随机选取CN组训练数据,计算其分类错误率CE作为适应度函数f。Specifically, in this step, the CN group training data is randomly selected from the data set in step (1), and its classification error rate CE is calculated as the fitness function f.

具体而言,分类错误率CE计算公式如下:Specifically, the calculation formula of the classification error rate CE is as follows:

Figure BDA0003032371950000141
Figure BDA0003032371950000141

其中,EN为分类错误的样本数,CN为训练数据样本数,其取值范围为100到500,优选为400。Among them, EN is the number of misclassified samples, CN is the number of training data samples, and its value ranges from 100 to 500, preferably 400.

上述步骤(2-1)到(2-7)的优点在于,利用混沌映射来产生混沌数,进而产生混沌种群,并取混沌种群和初始种群中质量较好的个体作为初始化个体,因此能够解决现有基于多种智能优化算法的入侵检测方法中种群质量分布较差和不能得到质量较高的最优解的技术问题。The advantages of the above steps (2-1) to (2-7) are that the chaotic map is used to generate the chaotic number, and then the chaotic population is generated, and the individual with better quality in the chaotic population and the initial population is taken as the initialization individual, so the solution The existing intrusion detection methods based on a variety of intelligent optimization algorithms have the technical problems that the population quality distribution is poor and the optimal solution with high quality cannot be obtained.

(2-8)判断cnt2是否等于最大迭代次数T,如果是,则输出全局最优解pbest={Cbestbest},过程结束,否则转入步骤(2-9);(2-8) Judging whether cnt2 is equal to the maximum number of iterations T, if so, output the global optimal solution p best ={C bestbest }, the process ends, otherwise go to step (2-9);

具体而言,最大迭代次数T的取值范围是500到1000,优选为500。Specifically, the value range of the maximum number of iterations T is 500 to 1000, preferably 500.

(2-9)判断cnt2是否为1,如果是,则将步骤(2-7)中得到的混沌初始化后的种群作为种群popmix,并从种群popmix中随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后转入步骤(2-10),否则进入步骤(2-33);(2-9) Determine whether cnt2 is 1, if so, take the chaotically initialized population obtained in step (2-7) as the population pop mix , and randomly select q population individuals from the population pop mix to form the population pop de , the remaining population individuals form population pop abc , and then go to step (2-10), otherwise go to step (2-33);

在本步骤中,q的取值范围是0到20。In this step, the value range of q is 0 to 20.

(2-10)针对步骤(2-9)得到的种群popde,获取该种群中所有个体的适应度值所构成的适应度值集合

Figure BDA0003032371950000142
取该适应度值集合中适应度最小的个体作为改进差分进化算法中的局部最优解
Figure BDA0003032371950000143
并设置计数器cnt3=1;(2-10) For the population pop de obtained in step (2-9), obtain a fitness value set composed of fitness values of all individuals in the population
Figure BDA0003032371950000142
Take the individual with the smallest fitness in the fitness value set as the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000143
And set the counter cnt3=1;

(2-11)判断cnt3是否等于最大子种群迭代次数I,如果是,则保存改进差分进化算法中的局部最优解

Figure BDA0003032371950000151
和种群popde,并转入步骤(2-18),否则转入步骤(2-12);(2-11) Determine whether cnt3 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000151
and population pop de , and go to step (2-18), otherwise go to step (2-12);

具体而言,最大子种群迭代次数I的取值范围是5到10,优选为10。Specifically, the maximum subpopulation iteration number I ranges from 5 to 10, preferably 10.

(2-12)判断cnt3是否为1,如果是,则获取步骤(2-10)得到的种群popde中所有个体的适应度值所构成的适应度值集合Fde,并转入步骤(2-13),否则进入步骤(2-17);(2-12) Determine whether cnt3 is 1, and if so, obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de obtained in step (2-10), and go to step (2) -13), otherwise go to step (2-17);

(2-13)针对步骤(2-12)得到的适应度值集合Fde,按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合

Figure BDA0003032371950000152
Figure BDA0003032371950000153
中最小适应度值对应的个体作为改进差分进化算法中的局部最优解
Figure BDA0003032371950000154
并取适应度值排前一半的种群个体组成集合
Figure BDA0003032371950000155
该适应度值集合
Figure BDA0003032371950000156
中剩余的个体组成集合
Figure BDA0003032371950000157
(2-13) For the fitness value set F de obtained in step (2-12), sort all fitness values in the fitness value set according to the order from small to large to obtain a new fitness value set
Figure BDA0003032371950000152
Pick
Figure BDA0003032371950000153
The individual corresponding to the minimum fitness value is used as the local optimal solution in the improved differential evolution algorithm
Figure BDA0003032371950000154
And take the top half of the population individuals with fitness value to form a set
Figure BDA0003032371950000155
The fitness value set
Figure BDA0003032371950000156
The remaining individuals form the set
Figure BDA0003032371950000157

(2-14)根据步骤(2-13)中得到的集合Fde中的第

Figure BDA0003032371950000158
个个体
Figure BDA0003032371950000159
生成自适应变异个体
Figure BDA00030323719500001510
其中
Figure BDA00030323719500001511
(2-14) According to the first in the set F de obtained in step (2-13)
Figure BDA0003032371950000158
individual
Figure BDA0003032371950000159
Generate adaptive mutant individuals
Figure BDA00030323719500001510
in
Figure BDA00030323719500001511

具体而言,生成自适应变异个体的计算公式如下:Specifically, the calculation formula for generating adaptive mutant individuals is as follows:

Figure BDA00030323719500001512
Figure BDA00030323719500001512

其中,

Figure BDA00030323719500001513
两者彼此不相同,且两者均不等于
Figure BDA00030323719500001514
Fc为自适应变异因子。in,
Figure BDA00030323719500001513
Both are not identical to each other, and neither is equal to
Figure BDA00030323719500001514
F c is the adaptive variation factor.

自适应变异因子Fc的计算公式如下:The formula for calculating the adaptive variation factor F c is as follows:

Figure BDA00030323719500001515
Figure BDA00030323719500001515

其中,fc是初始变异因子,其取值范围是0.5到0.8,优选为0.5。Among them, f c is the initial variation factor, and its value ranges from 0.5 to 0.8, preferably 0.5.

上述步骤(2-14)的优点在于,采用自适应变异因子来使变异因子进行动态改变,在迭代初期,采用较大的自适应变异因子来生成较多的扰动变量,以提高种群个体多样性,同时在迭代后期,采用较小的自适应变异因子来降低差分进化算法最优个体被破坏的概率,以提升算法的收敛速度,然后,通过精英进化策略来获取精英个体信息来提升算法的运行效率,因此能解决现有基于差分进化算法的入侵检测方法中收敛速度慢和计算精度较低的技术问题。The advantage of the above steps (2-14) is that the adaptive variation factor is used to dynamically change the variation factor. In the early stage of the iteration, a larger adaptive variation factor is used to generate more disturbance variables to improve the individual diversity of the population. At the same time, in the later stage of the iteration, a smaller adaptive mutation factor is used to reduce the probability of the optimal individual of the differential evolution algorithm being destroyed, so as to improve the convergence speed of the algorithm. Then, the elite individual information is obtained through the elite evolution strategy to improve the operation of the algorithm. Therefore, it can solve the technical problems of slow convergence speed and low calculation accuracy in the existing intrusion detection methods based on differential evolution algorithm.

(2-15)对步骤(2-14)得到的自适应变异个体

Figure BDA0003032371950000161
和步骤(2-13)中得到的集合Fde中的第
Figure BDA0003032371950000162
个个体
Figure BDA0003032371950000163
行交叉操作,以生成实验个体
Figure BDA0003032371950000164
(2-15) For the adaptive mutant individual obtained in step (2-14)
Figure BDA0003032371950000161
and the first in the set F de obtained in step (2-13)
Figure BDA0003032371950000162
individual
Figure BDA0003032371950000163
Crossover operation to generate experimental individuals
Figure BDA0003032371950000164

具体而言,生成实验个体的计算公式如下:Specifically, the calculation formula for generating experimental individuals is as follows:

Figure BDA0003032371950000165
Figure BDA0003032371950000165

其中,randn是随机产生于[1,D]之间的随机整数,rand是属于[0,1]之间的均匀分布的随机实数,CR是交叉因子,D为个体基因维度,其中h∈[1,D];Among them, randn is a random integer randomly generated between [1, D], rand is a random real number belonging to a uniform distribution between [0, 1], CR is the crossover factor, D is the individual gene dimension, where h∈[ 1, D];

具体而言,交叉因子CR的取值范围是0.1到0.9,优选为0.3,个体基因维度D的取值范围是1到10,优选为2。Specifically, the value range of the cross factor CR is 0.1 to 0.9, preferably 0.3, and the value range of the individual gene dimension D is 1 to 10, preferably 2.

(2-16)获取步骤(2-15)得到的实验个体

Figure BDA0003032371950000166
对应的适应度值以及步骤(2-13)得到的个体
Figure BDA0003032371950000167
对应的适应度值,使用二者中较小的适应度值所对应的个体代替适应度值集合Fde中的对应个体,从而得到更新后的种群popde,设置计数器cnt3=cnt3+1,并返回步骤(2-11);(2-16) Obtain the experimental individuals obtained in the step (2-15)
Figure BDA0003032371950000166
The corresponding fitness value and the individual obtained in step (2-13)
Figure BDA0003032371950000167
For the corresponding fitness value, use the individual corresponding to the smaller fitness value of the two to replace the corresponding individual in the fitness value set F de , so as to obtain the updated population pop de , set the counter cnt3=cnt3+1, and Return to step (2-11);

(2-17)获取步骤(2-16)更新后的种群popde中所有个体的适应度值所构成的适应度值集合Fde,然后返回步骤(2-13);(2-17) Obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de updated in step (2-16), and then return to step (2-13);

(2-18)针对步骤(2-9)中的种群popabc,获取该种群中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合

Figure BDA0003032371950000168
其中N-q为人工蜂群适应度值集合Fitabc中人工蜂群适应度值的总数,初始化禁忌表T1为种群popabc,禁忌表T2为空,并取人工蜂群适应度值集合Fitabc中人工蜂群适应度最小的个体作为改进人工蜂群算法中的局部最优解
Figure BDA0003032371950000171
并设置计数器cnt4=1;(2-18) For the population pop abc in step (2-9), obtain an artificial bee colony fitness value set composed of the artificial bee colony fitness values of all individuals in the population
Figure BDA0003032371950000168
Among them, Nq is the total number of artificial bee colony fitness values in the artificial bee colony fitness value set Fit abc , the initial taboo table T1 is the population pop abc , the taboo table T2 is empty, and the artificial bee colony fitness value set Fit abc is taken from the artificial bee colony fitness value set Fit abc. Individuals with the smallest swarm fitness as a local optimal solution in an improved artificial bee colony algorithm
Figure BDA0003032371950000171
And set the counter cnt4=1;

具体而言,本步骤中的人工蜂群适应度函数是采用以下公式:Specifically, the artificial bee colony fitness function in this step adopts the following formula:

Figure BDA0003032371950000172
Figure BDA0003032371950000172

其中f表示适应度函数,abs表示绝对值函数。where f is the fitness function and abs is the absolute value function.

上述步骤(2-18)的优点在于,采用禁忌表来储存人工蜂群中已经搜索到的解,在后续的迭代过程中不再搜索在禁忌表中已经储存的解,有效的避免了迭代过程中的重复搜索,防止算法陷入局部最优陷阱,因此能够解决现有基于人工蜂群算法的入侵检测方法中容易陷入局部最优陷阱和全局搜索能力不强的技术问题。The advantage of the above steps (2-18) is that the tabu table is used to store the solutions that have been searched in the artificial bee colony, and the solutions that have been stored in the tabu table are no longer searched in the subsequent iteration process, which effectively avoids the iterative process. The repeated search in the algorithm can prevent the algorithm from falling into the local optimal trap, so it can solve the technical problems that the existing intrusion detection methods based on the artificial bee colony algorithm are easy to fall into the local optimal trap and the global search ability is not strong.

(2-19)判断cnt4是否等于最大子种群迭代次数I,如果是,则保存改进人工蜂群算法中的局部最优解

Figure BDA0003032371950000173
和种群popabc,转入步骤(2-32),否则转入步骤(2-20);(2-19) Determine whether cnt4 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved artificial bee colony algorithm
Figure BDA0003032371950000173
and population pop abc , go to step (2-32), otherwise go to step (2-20);

(2-20)判断cnt4是否为1,如果是,则获取步骤(2-18)中的种群popabc中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合Fitabc,转入步骤(2-21),否则进入步骤(2-31);(2-20) Determine whether cnt4 is 1, and if so, obtain the artificial bee colony fitness value set Fit abc composed of the artificial bee colony fitness values of all individuals in the population pop abc in step (2-18), Go to step (2-21), otherwise go to step (2-31);

(2-21)根据步骤(2-20)中得到的集合Fitabc中的第

Figure BDA0003032371950000174
个蜜源个体
Figure BDA0003032371950000175
生成领域蜜源个体
Figure BDA0003032371950000176
其中
Figure BDA0003032371950000177
(2-21) According to the No. 1 in the set Fit abc obtained in step (2-20)
Figure BDA0003032371950000174
nectar source
Figure BDA0003032371950000175
Generate Domain Nectar Individuals
Figure BDA0003032371950000176
in
Figure BDA0003032371950000177

所述生成领域蜜源个体的计算公式如下:The calculation formula for generating the nectar source individuals in the field is as follows:

Figure BDA0003032371950000178
Figure BDA0003032371950000178

其中

Figure BDA0003032371950000179
且与
Figure BDA00030323719500001710
不相同,φ为邻域搜索因子,是-1到1的一个随机数。in
Figure BDA0003032371950000179
and with
Figure BDA00030323719500001710
Not the same, φ is the neighborhood search factor, which is a random number from -1 to 1.

(2-22)根据步骤(2-21)中得到的领域蜜源个体

Figure BDA00030323719500001711
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-21),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-23);(2-22) According to the field nectar source individuals obtained in step (2-21)
Figure BDA00030323719500001711
Determine whether the nectar source individuals in this field are in the taboo table T1 or T2, if so, go to step (2-21), otherwise, add the nectar source individuals in this field to the taboo table T1, and enter step (2-23);

(2-23)获取步骤(2-21)的蜜源个体

Figure BDA0003032371950000181
对应的人工蜂群适应度值
Figure BDA0003032371950000182
以及领域蜜源个体
Figure BDA0003032371950000183
对应的人工蜂群适应度值
Figure BDA0003032371950000184
判断
Figure BDA0003032371950000185
是否小于
Figure BDA0003032371950000186
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;(2-23) Obtain the nectar source individuals of step (2-21)
Figure BDA0003032371950000181
Corresponding artificial bee colony fitness value
Figure BDA0003032371950000182
and domain nectar individuals
Figure BDA0003032371950000183
Corresponding artificial bee colony fitness value
Figure BDA0003032371950000184
judge
Figure BDA0003032371950000185
Is it less than
Figure BDA0003032371950000186
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;

(2-24)计算通过步骤(2-23)中得到的更新后蜜源种群中的第

Figure BDA0003032371950000187
个蜜源个体的概率
Figure BDA0003032371950000188
并产生一个[0,1]范围的随机数,判断该随机数是否小于
Figure BDA0003032371950000189
如果是,则进入步骤(2-25),否则,进入步骤(2-28);(2-24) Calculate the No. 1 nectar population in the updated nectar population obtained in step (2-23)
Figure BDA0003032371950000187
The probability of a nectar source
Figure BDA0003032371950000188
And generate a random number in the range of [0,1] to determine whether the random number is less than
Figure BDA0003032371950000189
If yes, then go to step (2-25), otherwise, go to step (2-28);

所述生成概率的计算公式如下:The calculation formula of the generation probability is as follows:

Figure BDA00030323719500001810
Figure BDA00030323719500001810

(2-25)根据步骤(2-24)得到的蜜源个体

Figure BDA00030323719500001811
生成领域蜜源个体
Figure BDA00030323719500001812
其中
Figure BDA00030323719500001813
(2-25) The nectar source individual obtained according to step (2-24)
Figure BDA00030323719500001811
Generate Domain Nectar Individuals
Figure BDA00030323719500001812
in
Figure BDA00030323719500001813

(2-26)根据步骤(2-25)中得到的领域蜜源个体

Figure BDA00030323719500001814
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-25),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-27);(2-26) According to the field nectar source individual obtained in step (2-25)
Figure BDA00030323719500001814
Determine whether the nectar source individual in this field is in the taboo table T1 or T2, if so, go to step (2-25), otherwise, add the nectar source individual in this field to the taboo table T1, and enter step (2-27);

(2-27)获取步骤(2-24)的蜜源个体

Figure BDA00030323719500001815
对应的人工蜂群适应度值
Figure BDA00030323719500001816
以及步骤(2-25)的领域蜜源个体
Figure BDA00030323719500001817
对应的人工蜂群适应度值
Figure BDA00030323719500001818
判断
Figure BDA00030323719500001819
是否小于
Figure BDA00030323719500001820
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;(2-27) Obtain the nectar source individuals of step (2-24)
Figure BDA00030323719500001815
Corresponding artificial bee colony fitness value
Figure BDA00030323719500001816
And the domain nectar individual of step (2-25)
Figure BDA00030323719500001817
Corresponding artificial bee colony fitness value
Figure BDA00030323719500001818
judge
Figure BDA00030323719500001819
Is it less than
Figure BDA00030323719500001820
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;

(2-28)获取步骤(2-27)中Tr的最大未更新次数max,判断max是否大于蜜源最大搜索次数limit,如果是,将max对应的蜜源个体加入到T2中,并转到步骤(2-29),否则转到步骤(2-31);(2-28) Obtain the maximum number of unupdated times max of Tr in step (2-27), and determine whether max is greater than the maximum search times limit of the nectar source. If so, add the nectar source individual corresponding to max to T2, and go to step ( 2-29), otherwise go to step (2-31);

具体而言,蜜源最大搜索次数limit的取值范围是5到100,优选为50。Specifically, the value range of the maximum search times limit of the nectar source is 5 to 100, preferably 50.

(2-29)随机生成一个新的蜜源个体;(2-29) Randomly generate a new nectar source;

(2-30)判断步骤(2-29)中的蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-29),否则,将该蜜源个体加入禁忌表T1中,并获取更新后的种群popabc,并转到步骤(2-31),设置计数器cnt4=cnt4+1,并返回步骤(2-19);(2-30) Determine whether the nectar source individual in step (2-29) is in the taboo table T1 or T2, if so, go to step (2-29), otherwise, add the nectar source individual to the taboo table T1, and obtain The updated population pop abc , and go to step (2-31), set the counter cnt4=cnt4+1, and return to step (2-19);

(2-31)获取步骤(2-30)更新后的种群popabc中所有个体的适应度值所构成的适应度值集合Fitabc,然后返回步骤(2-20);(2-31) Obtain the fitness value set Fit abc formed by the fitness values of all individuals in the population pop abc updated in step (2-30), and then return to step (2-20);

(2-32)获取步骤(2-11)的局部最优解

Figure BDA0003032371950000191
对应的适应度值
Figure BDA0003032371950000192
以及步骤(2-19)的局部最优解
Figure BDA0003032371950000193
对应的适应度值
Figure BDA0003032371950000194
使用二者中较小的适应度值对应的个体来代替pbest,并将popde和popabc融合得到更新后的种群popmix,设置计数器cnt2=cnt2+1,并返回步骤(2-8);(2-32) Obtain the local optimal solution of step (2-11)
Figure BDA0003032371950000191
The corresponding fitness value
Figure BDA0003032371950000192
and the local optimal solution of step (2-19)
Figure BDA0003032371950000193
The corresponding fitness value
Figure BDA0003032371950000194
Use the individual corresponding to the smaller fitness value of the two to replace p best , and fuse pop de and pop abc to obtain the updated population pop mix , set the counter cnt2=cnt2+1, and return to step (2-8) ;

上述步骤(2-32)的优点在于,将改进后的差分进化算法和改进后的人工蜂群算法作为基本优化算法进行融合,因此能够解决现有基于多种智能优化算法的入侵检测方法中运行效率较低和算法性能不佳的技术问题。The advantage of the above steps (2-32) is that the improved differential evolution algorithm and the improved artificial bee colony algorithm are integrated as the basic optimization algorithm, so it can solve the problem of running in the existing intrusion detection methods based on multiple intelligent optimization algorithms. Technical issues with lower efficiency and poor algorithm performance.

(2-33)获取步骤(2-32)更新后的种群popmix,并随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后返回步骤(2-10);(2-33) Obtain the updated population pop mix in step (2-32), and randomly select q population individuals to form population pop de , and the remaining population individuals form population pop abc , and then return to step (2-10);

(3)对步骤(2)优化后的核极限学习机模型进行训练,以得到训练好的核极限学习机模型,并使用训练好的核极限学习机对数据集进行分类,以得到分类结果;(3) training the nuclear extreme learning machine model optimized in step (2) to obtain a trained nuclear extreme learning machine model, and using the trained nuclear extreme learning machine to classify the data set to obtain a classification result;

本步骤具体包括以下子步骤:This step specifically includes the following sub-steps:

(3-1)将步骤(1)标准化处理后的数据集按照7:3的比例分为训练集和测试集;(3-1) Divide the standardized data set in step (1) into a training set and a test set according to a ratio of 7:3;

(3-2)根据步骤(2)中得到的最优核参数γbest获取高斯核函数K(xki,xkj),并根据高斯核函数K(xki,xkj)和步骤(3-1)中得到的训练集获得训练好的核极限学习机模型;(3-2) Obtain the Gaussian kernel function K(x ki , x kj ) according to the optimal kernel parameter γ best obtained in step (2), and according to the Gaussian kernel function K(x ki , x kj ) and step (3- The training set obtained in 1) obtains a trained kernel extreme learning machine model;

本步骤中,使用最优核参数γbest获取高斯核函数K(xki,xkj)这一过程具体是:In this step, the process of using the optimal kernel parameter γ best to obtain the Gaussian kernel function K(x ki , x kj ) is as follows:

K(xki,xkj)=exp(-||xki-xkj||2best)K(x ki ,x kj )=exp(-||x ki -x kj || 2best )

所述核极限学习机模型的训练公式如下:The training formula of the kernel extreme learning machine model is as follows:

Figure BDA0003032371950000201
Figure BDA0003032371950000201

其中f(x)是核极限学习机的输出函数,KN是训练集的总数,ΩKELM是高斯核函数对应的核矩阵,T为训练集的标签,Cbest是根据步骤(2)中得到的最优惩罚系数。where f(x) is the output function of the kernel extreme learning machine, KN is the total number of training sets, Ω KELM is the kernel matrix corresponding to the Gaussian kernel function, T is the label of the training set, and C best is obtained according to step (2) optimal penalty coefficient.

(3-3)使用步骤(3-2)中训练好的核极限学习机模型对步骤(3-1)中的测试集进行分类,以得到分类结果。(3-3) Use the kernel extreme learning machine model trained in step (3-2) to classify the test set in step (3-1) to obtain a classification result.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that the above are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, etc., All should be included within the protection scope of the present invention.

Claims (10)

1.一种基于改进智能优化算法的入侵检测方法,其特征在于,包括以下步骤:1. an intrusion detection method based on improving intelligent optimization algorithm, is characterized in that, comprises the following steps: (1)获取数据集,使用z-score方法对数据集进行标准化处理,以得到标准化处理后的数据集;(1) Obtain a data set, and use the z-score method to standardize the data set to obtain a standardized data set; (2)通过改进智能优化算法优化核极限学习机模型的惩罚系数C和核系数γ,并得到优化后的核极限学习机模型;(2) Optimize the penalty coefficient C and the kernel coefficient γ of the kernel extreme learning machine model by improving the intelligent optimization algorithm, and obtain the optimized kernel extreme learning machine model; (3)对步骤(2)优化后的核极限学习机模型进行训练,以得到训练好的核极限学习机模型,并使用训练好的核极限学习机对数据集进行分类,以得到分类结果。(3) Train the kernel extreme learning machine model optimized in step (2) to obtain a trained kernel extreme learning machine model, and use the trained kernel extreme learning machine to classify the data set to obtain a classification result. 2.根据权利要求1所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(1)包括以下子步骤:2. the intrusion detection method based on improved intelligent optimization algorithm according to claim 1, is characterized in that, step (1) comprises following substep: (1-1)获取数据集Ds;(1-1) Obtain the dataset Ds;
Figure FDA0003032371940000011
Figure FDA0003032371940000011
其中,k为数据集Ds中的样本总数,n为数据集中样本的特征维数,
Figure FDA0003032371940000012
为Ds中第i行第j个样本点,其表示数据集Ds中第i个样本中的第j个特征属性值,且有i∈[1,k],j∈[1,n];
Among them, k is the total number of samples in the data set Ds, n is the feature dimension of the samples in the data set,
Figure FDA0003032371940000012
is the jth sample point in the ith row in Ds, which represents the jth feature attribute value in the ith sample in the data set Ds, and has i∈[1,k], j∈[1,n];
(1-2)从步骤(1-1)得到的数据集Ds中获取第i行第j个元素
Figure FDA0003032371940000013
并对其进行标准化处理,以得到标准化后的特征属性值
Figure FDA0003032371940000014
(1-2) Obtain the jth element of the i-th row from the data set Ds obtained in step (1-1)
Figure FDA0003032371940000013
And normalize it to get the normalized feature attribute value
Figure FDA0003032371940000014
(1-3)针对数据集Ds中的剩余样本点,重复上述步骤(1-2),直到数据集Ds中的所有样本点都被处理完毕为止,从而得到标准化后的数据集Ds。(1-3) For the remaining sample points in the data set Ds, repeat the above step (1-2) until all the sample points in the data set Ds have been processed, thereby obtaining the standardized data set Ds.
3.根据权利要求1或2所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(1-2)中的标准化处理的计算公式如下:3. the intrusion detection method based on improved intelligent optimization algorithm according to claim 1 and 2, is characterized in that, the calculation formula of the standardized processing in step (1-2) is as follows:
Figure FDA0003032371940000021
Figure FDA0003032371940000021
其中,μj是数据集Ds中第j列的均值,σj是数据集Ds中第j列的标准差。where μj is the mean of the jth column in the dataset Ds, and σj is the standard deviation of the jth column in the dataset Ds.
4.根据权利要求1至3中任意一项所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(2)具体包括以下子步骤:4. the intrusion detection method based on the improved intelligent optimization algorithm according to any one of claims 1 to 3, is characterized in that, step (2) specifically comprises the following sub-steps: (2-1)随机生成种群规模为N的初始种群pop={p1,p2,…,pN},并设置计数器cnt=1,其中种群中第m个个体为pm={Cmm},m∈[1,N],Cm和γm分别表示第m个个体的惩罚系数和核系数;(2-1) Randomly generate an initial population pop={p 1 ,p 2 ,...,p N } with a population size of N, and set the counter cnt=1, where the mth individual in the population is p m ={C mm }, m∈[1,N], C m and γ m represent the penalty coefficient and kernel coefficient of the mth individual, respectively; (2-2)判断cnt是否大于种群规模N,如果是,则转入步骤(2-4),否则转入步骤(2-3);(2-2) Judging whether cnt is greater than the population size N, if so, go to step (2-4), otherwise go to step (2-3); (2-3)判断cnt是否为1,如果是,则随机生成位于(0,1)范围内、且不能等于0.25、0.5和0.75的混沌数α(1),设置计数器cnt=cnt+1,并返回步骤(2-2),否则生成第cnt个混沌数α(cnt),设置计数器cnt=cnt+1,并返回步骤(2-2);(2-3) Determine whether cnt is 1. If so, randomly generate a chaotic number α(1) that is in the range of (0,1) and cannot be equal to 0.25, 0.5 and 0.75, and set the counter cnt=cnt+1, And return to step (2-2), otherwise generate the cnt th chaotic number α(cnt), set the counter cnt=cnt+1, and return to step (2-2); (2-4)设置计数器cnt1=1;(2-4) Set the counter cnt1=1; (2-5)判断cnt1是否大于种群规模N,如果是,则转入步骤(2-7),否则转入步骤(2-6);(2-5) Judging whether cnt1 is greater than the population size N, if so, go to step (2-7), otherwise go to step (2-6); (2-6)生成第cnt1个混沌个体
Figure FDA0003032371940000022
设置计数器cnt1=cnt1+1,并返回步骤(2-5);
(2-6) Generate the cnt1 chaotic individual
Figure FDA0003032371940000022
Set the counter cnt1=cnt1+1, and return to step (2-5);
(2-7)将生成的N个混沌个体与步骤(2-1)中生成的初始种群混合,以得到混合种群mixpop={mix1,mix2,…,mix2N},获取该混合种群中所有个体的适应度值所构成的适应度值集合F={f(mix1),f(mix2),…,f(mixsn)},按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合
Figure FDA0003032371940000031
并取新的适应度值集合中前N个个体作为混沌初始化后的种群,取新的适应度值集合中最小适应度值对应的个体作为全局最优解pbest,并设置计数器cnt2=1,其中sn为适应度值集合F中适应度值的总数;
(2-7) Mix the generated N chaotic individuals with the initial population generated in step (2-1) to obtain a mixed population mixpop={mix 1 , mix 2 ,..., mix 2N }, and obtain the The fitness value set F={f(mix 1 ),f(mix 2 ),...,f(mix sn )} formed by the fitness values of all individuals, in this fitness value set in the order from small to large to sort all fitness values of , to obtain a new set of fitness values
Figure FDA0003032371940000031
And take the first N individuals in the new fitness value set as the population after chaotic initialization, take the individual corresponding to the minimum fitness value in the new fitness value set as the global optimal solution p best , and set the counter cnt2=1, where sn is the total number of fitness values in the fitness value set F;
(2-8)判断cnt2是否等于最大迭代次数T,如果是,则输出全局最优解pbest={Cbestbest},过程结束,否则转入步骤(2-9);(2-8) Judging whether cnt2 is equal to the maximum number of iterations T, if so, output the global optimal solution p best ={C bestbest }, the process ends, otherwise go to step (2-9); (2-9)判断cnt2是否为1,如果是,则将步骤(2-7)中得到的混沌初始化后的种群作为种群popmix,并从种群popmix中随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后转入步骤(2-10),否则进入步骤(2-33);(2-9) Determine whether cnt2 is 1, if so, take the chaotically initialized population obtained in step (2-7) as the population pop mix , and randomly select q population individuals from the population pop mix to form the population pop de , the remaining population individuals form population pop abc , and then go to step (2-10), otherwise go to step (2-33); (2-10)针对步骤(2-9)得到的种群popde,获取该种群中所有个体的适应度值所构成的适应度值集合
Figure FDA0003032371940000032
取该适应度值集合中适应度最小的个体作为改进差分进化算法中的局部最优解
Figure FDA0003032371940000033
并设置计数器cnt3=1;
(2-10) For the population pop de obtained in step (2-9), obtain a fitness value set composed of fitness values of all individuals in the population
Figure FDA0003032371940000032
Take the individual with the smallest fitness in the fitness value set as the local optimal solution in the improved differential evolution algorithm
Figure FDA0003032371940000033
And set the counter cnt3=1;
(2-11)判断cnt3是否等于最大子种群迭代次数I,如果是,则保存改进差分进化算法中的局部最优解
Figure FDA0003032371940000034
和种群popde,并转入步骤(2-18),否则转入步骤(2-12);
(2-11) Determine whether cnt3 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved differential evolution algorithm
Figure FDA0003032371940000034
and population pop de , and go to step (2-18), otherwise go to step (2-12);
(2-12)判断cnt3是否为1,如果是,则获取步骤(2-10)得到的种群popde中所有个体的适应度值所构成的适应度值集合Fde,并转入步骤(2-13),否则进入步骤(2-17);(2-12) Determine whether cnt3 is 1, and if so, obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de obtained in step (2-10), and go to step (2) -13), otherwise go to step (2-17); (2-13)针对步骤(2-12)得到的适应度值集合Fde,按照从小到大的顺序对该适应度值集合中的所有适应度值进行排序,以获取新的适应度值集合
Figure FDA0003032371940000035
Figure FDA0003032371940000036
中最小适应度值对应的个体作为改进差分进化算法中的局部最优解
Figure FDA0003032371940000037
并取适应度值排前一半的种群个体组成集合
Figure FDA0003032371940000041
该适应度值集合
Figure FDA0003032371940000042
中剩余的个体组成集合
Figure FDA0003032371940000043
(2-13) For the fitness value set F de obtained in step (2-12), sort all fitness values in the fitness value set according to the order from small to large to obtain a new fitness value set
Figure FDA0003032371940000035
Pick
Figure FDA0003032371940000036
The individual corresponding to the minimum fitness value is used as the local optimal solution in the improved differential evolution algorithm
Figure FDA0003032371940000037
And take the top half of the population individuals with fitness value to form a set
Figure FDA0003032371940000041
The fitness value set
Figure FDA0003032371940000042
The remaining individuals in the set form a set
Figure FDA0003032371940000043
(2-14)根据步骤(2-13)中得到的集合Fde中的第
Figure FDA0003032371940000044
个个体
Figure FDA0003032371940000045
生成自适应变异个体
Figure FDA0003032371940000046
其中
Figure FDA0003032371940000047
(2-14) According to the first in the set F de obtained in step (2-13)
Figure FDA0003032371940000044
individual
Figure FDA0003032371940000045
Generate adaptive mutant individuals
Figure FDA0003032371940000046
in
Figure FDA0003032371940000047
(2-15)对步骤(2-14)得到的自适应变异个体
Figure FDA0003032371940000048
和步骤(2-13)中得到的集合Fde中的第
Figure FDA0003032371940000049
个个体
Figure FDA00030323719400000410
行交叉操作,以生成实验个体
Figure FDA00030323719400000411
(2-15) For the adaptive mutant individual obtained in step (2-14)
Figure FDA0003032371940000048
and the first in the set F de obtained in step (2-13)
Figure FDA0003032371940000049
individual
Figure FDA00030323719400000410
Crossover operation to generate experimental individuals
Figure FDA00030323719400000411
(2-16)获取步骤(2-15)得到的实验个体
Figure FDA00030323719400000412
对应的适应度值以及步骤(2-13)得到的个体
Figure FDA00030323719400000413
对应的适应度值,使用二者中较小的适应度值所对应的个体代替适应度值集合Fde中的对应个体,从而得到更新后的种群popde,设置计数器cnt3=cnt3+1,并返回步骤(2-11);
(2-16) Obtain the experimental individuals obtained in the step (2-15)
Figure FDA00030323719400000412
The corresponding fitness value and the individual obtained in step (2-13)
Figure FDA00030323719400000413
For the corresponding fitness value, use the individual corresponding to the smaller fitness value of the two to replace the corresponding individual in the fitness value set F de , so as to obtain the updated population pop de , set the counter cnt3=cnt3+1, and Return to step (2-11);
(2-17)获取步骤(2-16)更新后的种群popde中所有个体的适应度值所构成的适应度值集合Fde,然后返回步骤(2-13);(2-17) Obtain the fitness value set F de formed by the fitness values of all individuals in the population pop de updated in step (2-16), and then return to step (2-13); (2-18)针对步骤(2-9)中的种群popabc,获取该种群中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合
Figure FDA00030323719400000414
其中N-q为人工蜂群适应度值集合Fitabc中人工蜂群适应度值的总数,初始化禁忌表T1为种群popabc,禁忌表T2为空,并取人工蜂群适应度值集合Fitabc中人工蜂群适应度最小的个体作为改进人工蜂群算法中的局部最优解
Figure FDA00030323719400000415
并设置计数器cnt4=1;
(2-18) For the population pop abc in step (2-9), obtain an artificial bee colony fitness value set composed of the artificial bee colony fitness values of all individuals in the population
Figure FDA00030323719400000414
Among them, Nq is the total number of artificial bee colony fitness values in the artificial bee colony fitness value set Fit abc , the initial taboo table T1 is the population pop abc , the taboo table T2 is empty, and the artificial bee colony fitness value set Fit abc is taken from the artificial bee colony fitness value set Fit abc. Individuals with the smallest swarm fitness as a local optimal solution in an improved artificial bee colony algorithm
Figure FDA00030323719400000415
And set the counter cnt4=1;
(2-19)判断cnt4是否等于最大子种群迭代次数I,如果是,则保存改进人工蜂群算法中的局部最优解
Figure FDA00030323719400000416
和种群popabc,转入步骤(2-32),否则转入步骤(2-20);
(2-19) Determine whether cnt4 is equal to the maximum number of subpopulation iterations I, and if so, save the local optimal solution in the improved artificial bee colony algorithm
Figure FDA00030323719400000416
and population pop abc , go to step (2-32), otherwise go to step (2-20);
(2-20)判断cnt4是否为1,如果是,则获取步骤(2-18)中的种群popabc中所有个体的人工蜂群适应度值所构成的人工蜂群适应度值集合Fitabc,转入步骤(2-21),否则进入步骤(2-31);(2-20) Determine whether cnt4 is 1, and if so, obtain the artificial bee colony fitness value set Fit abc composed of the artificial bee colony fitness values of all individuals in the population pop abc in step (2-18), Go to step (2-21), otherwise go to step (2-31); (2-21)根据步骤(2-20)中得到的集合Fitabc中的第
Figure FDA0003032371940000051
个蜜源个体
Figure FDA0003032371940000052
生成领域蜜源个体
Figure FDA0003032371940000053
其中
Figure FDA0003032371940000054
(2-21) According to the No. 1 in the set Fit abc obtained in step (2-20)
Figure FDA0003032371940000051
nectar source
Figure FDA0003032371940000052
Generate Domain Nectar Individuals
Figure FDA0003032371940000053
in
Figure FDA0003032371940000054
(2-22)根据步骤(2-21)中得到的领域蜜源个体
Figure FDA0003032371940000055
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-21),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-23);
(2-22) According to the field nectar source individuals obtained in step (2-21)
Figure FDA0003032371940000055
Determine whether the nectar source individuals in this field are in the taboo table T1 or T2, if so, go to step (2-21), otherwise, add the nectar source individuals in this field to the taboo table T1, and enter step (2-23);
(2-23)获取步骤(2-21)的蜜源个体
Figure FDA0003032371940000056
对应的人工蜂群适应度值
Figure FDA0003032371940000057
以及领域蜜源个体
Figure FDA0003032371940000058
对应的人工蜂群适应度值
Figure FDA0003032371940000059
判断
Figure FDA00030323719400000510
是否小于
Figure FDA00030323719400000511
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;
(2-23) Obtain the nectar source individuals of step (2-21)
Figure FDA0003032371940000056
Corresponding artificial bee colony fitness value
Figure FDA0003032371940000057
and domain nectar individuals
Figure FDA0003032371940000058
Corresponding artificial bee colony fitness value
Figure FDA0003032371940000059
judge
Figure FDA00030323719400000510
Is it less than
Figure FDA00030323719400000511
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;
(2-24)计算通过步骤(2-23)中得到的更新后蜜源种群中的第
Figure FDA00030323719400000512
个蜜源个体的概率
Figure FDA00030323719400000513
并产生一个[0,1]范围的随机数,判断该随机数是否小于
Figure FDA00030323719400000514
如果是,则进入步骤(2-25),否则,进入步骤(2-28);
(2-24) Calculate the No. 1 nectar population in the updated nectar population obtained in step (2-23)
Figure FDA00030323719400000512
The probability of a nectar source
Figure FDA00030323719400000513
And generate a random number in the range of [0,1] to determine whether the random number is less than
Figure FDA00030323719400000514
If yes, then go to step (2-25), otherwise, go to step (2-28);
(2-25)根据步骤(2-24)得到的蜜源个体
Figure FDA00030323719400000515
生成领域蜜源个体
Figure FDA00030323719400000516
其中
Figure FDA00030323719400000517
(2-25) The nectar source individual obtained according to step (2-24)
Figure FDA00030323719400000515
Generate Domain Nectar Individuals
Figure FDA00030323719400000516
in
Figure FDA00030323719400000517
(2-26)根据步骤(2-25)中得到的领域蜜源个体
Figure FDA00030323719400000518
判断该领域蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-25),否则,将该领域蜜源个体加入禁忌表T1中,并进入步骤(2-27);
(2-26) According to the field nectar source individual obtained in step (2-25)
Figure FDA00030323719400000518
Determine whether the nectar source individuals in this field are in the taboo table T1 or T2, if so, go to step (2-25), otherwise, add the nectar source individuals in this field to the taboo table T1, and enter step (2-27);
(2-27)获取步骤(2-24)的蜜源个体
Figure FDA00030323719400000519
对应的人工蜂群适应度值
Figure FDA00030323719400000520
以及步骤(2-25)的领域蜜源个体
Figure FDA00030323719400000521
对应的人工蜂群适应度值
Figure FDA00030323719400000522
判断
Figure FDA00030323719400000523
是否小于
Figure FDA00030323719400000524
如果是,领域蜜源个体代替原种群的蜜源个体,否则将未更新蜜源表Tr中对应蜜源个体的未更新次数加1;
(2-27) Obtain the nectar source individuals of step (2-24)
Figure FDA00030323719400000519
Corresponding artificial bee colony fitness value
Figure FDA00030323719400000520
And the domain nectar individual of step (2-25)
Figure FDA00030323719400000521
Corresponding artificial bee colony fitness value
Figure FDA00030323719400000522
judge
Figure FDA00030323719400000523
Is it less than
Figure FDA00030323719400000524
If yes, the domain nectar source individual replaces the nectar source individual of the original population, otherwise the unupdated number of the corresponding nectar source individual in the unupdated nectar source table Tr is increased by 1;
(2-28)获取步骤(2-27)中Tr的最大未更新次数max,判断max是否大于蜜源最大搜索次数limit,如果是,将max对应的蜜源个体加入到T2中,并转到步骤(2-29),否则转到步骤(2-31);(2-28) Obtain the maximum number of unupdated times max of Tr in step (2-27), and determine whether max is greater than the maximum search times limit of the nectar source. If so, add the nectar source individual corresponding to max to T2, and go to step ( 2-29), otherwise go to step (2-31); (2-29)随机生成一个新的蜜源个体;(2-29) Randomly generate a new nectar source; (2-30)判断步骤(2-29)中的蜜源个体是否在禁忌表T1或者T2中,如果是则进入步骤(2-29),否则,将该蜜源个体加入禁忌表T1中,并获取更新后的种群popabc,并转到步骤(2-31),设置计数器cnt4=cnt4+1,并返回步骤(2-19);(2-30) Determine whether the nectar source individual in step (2-29) is in the taboo table T1 or T2, if so, enter step (2-29), otherwise, add the nectar source individual to the taboo table T1, and obtain The updated population pop abc , and go to step (2-31), set the counter cnt4=cnt4+1, and return to step (2-19); (2-31)获取步骤(2-30)更新后的种群popabc中所有个体的适应度值所构成的适应度值集合Fitabc,然后返回步骤(2-20);(2-31) Obtain the fitness value set Fit abc formed by the fitness values of all individuals in the population pop abc updated in step (2-30), and then return to step (2-20); (2-32)获取步骤(2-11)的局部最优解
Figure FDA0003032371940000061
对应的适应度值
Figure FDA0003032371940000062
以及步骤(2-19)的局部最优解
Figure FDA0003032371940000063
对应的适应度值
Figure FDA0003032371940000064
使用二者中较小的适应度值对应的个体来代替pbest,并将popde和popabc融合得到更新后的种群popmix,设置计数器cnt2=cnt2+1,并返回步骤(2-8);
(2-32) Obtain the local optimal solution of step (2-11)
Figure FDA0003032371940000061
The corresponding fitness value
Figure FDA0003032371940000062
and the local optimal solution of step (2-19)
Figure FDA0003032371940000063
The corresponding fitness value
Figure FDA0003032371940000064
Use the individual corresponding to the smaller fitness value of the two to replace p best , and fuse pop de and pop abc to get the updated population pop mix , set the counter cnt2=cnt2+1, and return to step (2-8) ;
(2-33)获取步骤(2-32)更新后的种群popmix,并随机选择q个种群个体形成种群popde,剩下的种群个体形成种群popabc,然后返回步骤(2-10)。(2-33) Obtain the updated population pop mix in step (2-32), randomly select q population individuals to form population pop de , and the remaining population individuals form population pop abc , and then return to step (2-10).
5.根据权利要求4所述的基于改进智能优化算法的入侵检测方法,其特征在于,5. the intrusion detection method based on improved intelligent optimization algorithm according to claim 4, is characterized in that, 步骤(2-3)中生成混沌数的计算公式如下:The calculation formula for generating the chaotic number in step (2-3) is as follows: α(cnt)=μ·α(cnt)·(1-α(cnt-1))α(cnt)=μ·α(cnt)·(1-α(cnt-1)) 其中,μ是相关系数,其取值范围是0到4,优选为4。Among them, μ is the correlation coefficient, and its value ranges from 0 to 4, preferably 4. 步骤(2-6)中生成第cnt1个混沌个体
Figure FDA0003032371940000065
的计算公式如下:
Generate the cnt1 chaotic individual in step (2-6)
Figure FDA0003032371940000065
The calculation formula is as follows:
Figure FDA0003032371940000066
Figure FDA0003032371940000066
其中,pcnt1是第cnt1个初始种群个体,α(cnt1)是第cnt1个混沌数。Among them, p cnt1 is the cnt1-th initial population individual, and α(cnt1) is the cnt1-th chaotic number. 步骤(2-7)是从步骤(1)中的数据集中随机选取CN组训练数据,计算其分类错误率CE作为适应度函数f,其中分类错误率CE计算公式如下:Step (2-7) is to randomly select the CN group training data from the data set in step (1), and calculate its classification error rate CE as the fitness function f, wherein the calculation formula of the classification error rate CE is as follows:
Figure FDA0003032371940000067
Figure FDA0003032371940000067
其中,EN为分类错误的样本数,CN为训练数据样本数。Among them, EN is the number of misclassified samples, and CN is the number of training data samples.
6.根据权利要求4所述的基于改进智能优化算法的入侵检测方法,其特征在于,6. the intrusion detection method based on improved intelligent optimization algorithm according to claim 4, is characterized in that, 步骤(2-14)中生成自适应变异个体的计算公式如下:The calculation formula for generating adaptive mutant individuals in step (2-14) is as follows:
Figure FDA0003032371940000071
Figure FDA0003032371940000071
其中,
Figure FDA0003032371940000072
两者彼此不相同,且两者均不等于
Figure FDA0003032371940000079
Fc为自适应变异因子;
in,
Figure FDA0003032371940000072
Both are not identical to each other, and neither is equal to
Figure FDA0003032371940000079
F c is the adaptive variation factor;
自适应变异因子Fc的计算公式如下:The formula for calculating the adaptive variation factor F c is as follows:
Figure FDA0003032371940000073
Figure FDA0003032371940000073
其中,fc是初始变异因子;where f c is the initial variation factor; 步骤(2-15)中生成实验个体的计算公式如下:The calculation formula for generating experimental individuals in step (2-15) is as follows:
Figure FDA0003032371940000074
Figure FDA0003032371940000074
其中,randn是随机产生于[1,D]之间的随机整数,rand是属于[0,1]之间的均匀分布的随机实数,CR是交叉因子,D为个体基因维度,其中h∈[1,D];Among them, randn is a random integer randomly generated between [1, D], rand is a random real number belonging to a uniform distribution between [0, 1], CR is the crossover factor, D is the individual gene dimension, where h∈[ 1, D]; 步骤(2-18)中的人工蜂群适应度函数是采用以下公式:The artificial bee colony fitness function in step (2-18) adopts the following formula:
Figure FDA0003032371940000075
Figure FDA0003032371940000075
其中f表示适应度函数,abs表示绝对值函数。where f is the fitness function and abs is the absolute value function.
7.根据权利要求4所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(2-21)中生成领域蜜源个体的计算公式如下:7. the intrusion detection method based on improved intelligent optimization algorithm according to claim 4, is characterized in that, in step (2-21), the calculation formula that generates domain nectar source individual is as follows:
Figure FDA0003032371940000076
Figure FDA0003032371940000076
其中
Figure FDA0003032371940000077
且与
Figure FDA0003032371940000078
不相同,φ为邻域搜索因子,是-1到1的一个随机数。
in
Figure FDA0003032371940000077
and with
Figure FDA0003032371940000078
Not the same, φ is the neighborhood search factor, which is a random number from -1 to 1.
步骤(2-24)中生成概率的计算公式如下:The calculation formula of the generation probability in step (2-24) is as follows:
Figure FDA0003032371940000081
Figure FDA0003032371940000081
8.根据权利要求1所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(3)具体包括以下子步骤:8. the intrusion detection method based on improved intelligent optimization algorithm according to claim 1, is characterized in that, step (3) specifically comprises following substep: (3-1)将步骤(1)标准化处理后的数据集按照7:3的比例分为训练集和测试集;(3-1) Divide the standardized data set in step (1) into a training set and a test set according to a ratio of 7:3; (3-2)根据步骤(2)中得到的最优核参数γbest获取高斯核函数K(xki,xkj),并根据高斯核函数K(xki,xkj)和步骤(3-1)中得到的训练集获得训练好的核极限学习机模型;(3-2) Obtain the Gaussian kernel function K(x ki , x kj ) according to the optimal kernel parameter γ best obtained in step (2), and according to the Gaussian kernel function K(x ki , x kj ) and step (3- The training set obtained in 1) obtains a trained kernel extreme learning machine model; (3-3)使用步骤(3-2)中训练好的核极限学习机模型对步骤(3-1)中的测试集进行分类,以得到分类结果。(3-3) Use the kernel extreme learning machine model trained in step (3-2) to classify the test set in step (3-1) to obtain a classification result. 9.根据权利要求8所述的基于改进智能优化算法的入侵检测方法,其特征在于,步骤(3-2)中,使用最优核参数γbest获取高斯核函数K(xki,xkj)这一过程具体是:9. the intrusion detection method based on improved intelligent optimization algorithm according to claim 8, is characterized in that, in step (3-2), use optimal kernel parameter γ best to obtain Gaussian kernel function K (x ki , x kj ) Specifically, this process is: K(xki,xkj)=exp(-||xki-xkj||2best)K(x ki ,x kj )=exp(-||x ki -x kj || 2best ) 核极限学习机模型的训练公式如下:The training formula of the kernel extreme learning machine model is as follows:
Figure FDA0003032371940000082
Figure FDA0003032371940000082
其中f(x)是核极限学习机的输出函数,KN是训练集的总数,ΩKELM是高斯核函数对应的核矩阵,T为训练集的标签,Cbest是根据步骤(2)中得到的最优惩罚系数。where f(x) is the output function of the kernel extreme learning machine, KN is the total number of training sets, Ω KELM is the kernel matrix corresponding to the Gaussian kernel function, T is the label of the training set, and C best is obtained according to step (2) optimal penalty coefficient.
10.一种基于改进智能优化算法的入侵检测系统,其特征在于,包括:10. An intrusion detection system based on an improved intelligent optimization algorithm, characterized in that, comprising: 第一模块,用于获取数据集,使用z-score方法对数据集进行标准化处理,以得到标准化处理后的数据集;The first module is used to obtain the data set, and use the z-score method to standardize the data set to obtain the standardized data set; 第二模块,用于通过改进智能优化算法优化核极限学习机模型的惩罚系数C和核系数γ,并得到优化后的核极限学习机模型;The second module is used to optimize the penalty coefficient C and the kernel coefficient γ of the kernel extreme learning machine model by improving the intelligent optimization algorithm, and obtain the optimized kernel extreme learning machine model; 第三模块,用于对第二模块优化后的核极限学习机模型进行训练,以得到训练好的核极限学习机模型,并使用训练好的核极限学习机对数据集进行分类,以得到分类结果。The third module is used to train the kernel extreme learning machine model optimized by the second module to obtain the trained kernel extreme learning machine model, and use the trained kernel extreme learning machine to classify the data set to obtain the classification result.
CN202110434602.8A 2021-04-22 2021-04-22 Intrusion detection method and system based on improved intelligent optimization algorithm Active CN113139598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110434602.8A CN113139598B (en) 2021-04-22 2021-04-22 Intrusion detection method and system based on improved intelligent optimization algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110434602.8A CN113139598B (en) 2021-04-22 2021-04-22 Intrusion detection method and system based on improved intelligent optimization algorithm

Publications (2)

Publication Number Publication Date
CN113139598A true CN113139598A (en) 2021-07-20
CN113139598B CN113139598B (en) 2022-04-22

Family

ID=76813305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110434602.8A Active CN113139598B (en) 2021-04-22 2021-04-22 Intrusion detection method and system based on improved intelligent optimization algorithm

Country Status (1)

Country Link
CN (1) CN113139598B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110224565A1 (en) * 2010-03-15 2011-09-15 Singapore Health Services Pte Ltd. Method of predicting acute cardiopulmonary events and survivability of a patient
CN105354363A (en) * 2015-10-09 2016-02-24 上海大学 Fluctuation wind speed prediction method based on extreme learning machine
CN106228184A (en) * 2016-07-19 2016-12-14 东北大学 A kind of based on the blast furnace fault detection system and the method that optimize extreme learning machine
CN106790248A (en) * 2017-01-23 2017-05-31 中南大学 A kind of network inbreak detection method based on the online extreme learning machine of double adaptive regularization
CN107180190A (en) * 2016-03-11 2017-09-19 深圳先进技术研究院 A kind of Android malware detection method and system based on composite character
CN107911346A (en) * 2017-10-31 2018-04-13 天津大学 A kind of intrusion detection method based on extreme learning machine
CN108520272A (en) * 2018-03-22 2018-09-11 江南大学 A Semi-supervised Intrusion Detection Method Based on Improved Cangwolf Algorithm
CN109818798A (en) * 2019-02-19 2019-05-28 上海海事大学 A wireless sensor network intrusion detection system and method integrating KPCA and ELM
CN109886350A (en) * 2019-02-25 2019-06-14 东北农业大学 A method for predicting the digestible energy of dairy cows' diets based on the kernel extreme learning machine
WO2019129915A1 (en) * 2017-12-29 2019-07-04 Nokia Solutions And Networks Oy Intelligent defense and filtration platform for network traffic
CN111209563A (en) * 2019-12-27 2020-05-29 北京邮电大学 Network intrusion detection method and system
CN111860638A (en) * 2020-07-17 2020-10-30 湖南大学 Parallel Intrusion Detection Method and System Based on Imbalanced Data Deep Belief Network
CN112383563A (en) * 2020-12-03 2021-02-19 中国铁建重工集团股份有限公司 Intrusion detection method and related device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110224565A1 (en) * 2010-03-15 2011-09-15 Singapore Health Services Pte Ltd. Method of predicting acute cardiopulmonary events and survivability of a patient
CN105354363A (en) * 2015-10-09 2016-02-24 上海大学 Fluctuation wind speed prediction method based on extreme learning machine
CN107180190A (en) * 2016-03-11 2017-09-19 深圳先进技术研究院 A kind of Android malware detection method and system based on composite character
CN106228184A (en) * 2016-07-19 2016-12-14 东北大学 A kind of based on the blast furnace fault detection system and the method that optimize extreme learning machine
CN106790248A (en) * 2017-01-23 2017-05-31 中南大学 A kind of network inbreak detection method based on the online extreme learning machine of double adaptive regularization
CN107911346A (en) * 2017-10-31 2018-04-13 天津大学 A kind of intrusion detection method based on extreme learning machine
WO2019129915A1 (en) * 2017-12-29 2019-07-04 Nokia Solutions And Networks Oy Intelligent defense and filtration platform for network traffic
CN108520272A (en) * 2018-03-22 2018-09-11 江南大学 A Semi-supervised Intrusion Detection Method Based on Improved Cangwolf Algorithm
CN109818798A (en) * 2019-02-19 2019-05-28 上海海事大学 A wireless sensor network intrusion detection system and method integrating KPCA and ELM
CN109886350A (en) * 2019-02-25 2019-06-14 东北农业大学 A method for predicting the digestible energy of dairy cows' diets based on the kernel extreme learning machine
CN111209563A (en) * 2019-12-27 2020-05-29 北京邮电大学 Network intrusion detection method and system
CN111860638A (en) * 2020-07-17 2020-10-30 湖南大学 Parallel Intrusion Detection Method and System Based on Imbalanced Data Deep Belief Network
CN112383563A (en) * 2020-12-03 2021-02-19 中国铁建重工集团股份有限公司 Intrusion detection method and related device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LI Y ET AL.: "Research of Intrusion Detection Based on Ensemble Learning Model", 《AMM 2013》 *
李肯立 等: "无线局域网中的入侵检测系统研究", 《科学技术与工程》 *
杜晔 等: "基于优化核极限学习机的工控入侵检测方法", 《信息网络安全》 *

Also Published As

Publication number Publication date
CN113139598B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
Lu et al. Learning to pre-train graph neural networks
Ma et al. Subgroup generalization and fairness of graph neural networks
Jardaneh et al. Classifying Arabic tweets based on credibility using content and user features
WO2023155508A1 (en) Graph convolutional neural network and knowledge base-based paper correlation analysis method
CN114692741B (en) Generalized face counterfeiting detection method based on domain invariant features
CN113922985A (en) A network intrusion detection method and system based on ensemble learning
Ding et al. HYBRID‐CNN: An Efficient Scheme for Abnormal Flow Detection in the SDN‐Based Smart Grid
CN113343126A (en) Rumor detection method based on event and propagation structure
Li et al. SybilFlyover: Heterogeneous graph-based fake account detection model on social networks
CN106528705A (en) Repeated record detection method and system based on RBF neural network
CN103150383A (en) Event evolution analysis method of short text data
Nie et al. Temporal-structural importance weighted graph convolutional network for temporal knowledge graph completion
CN115952343A (en) Social robot detection method based on multi-relation graph convolutional network
CN117272195A (en) Block chain abnormal node detection method and system based on graph convolution attention network
CN116647844A (en) A Vehicle Network Intrusion Detection Method Based on Stacking Integration Algorithm
CN112612970A (en) Microblog event relation-based rumor detection method and system
CN113139598B (en) Intrusion detection method and system based on improved intelligent optimization algorithm
CN111400617B (en) A method and system for expanding social robot detection dataset based on active learning
CN105468669A (en) Adaptive microblog topic tracking method fusing with user relationship
Singh et al. Comparative benchmarking of causal discovery techniques
Krithiga et al. A comprehensive survey of spam profile detection methods in online social networks
İş et al. A Profile Analysis of User Interaction in Social Media Using Deep Learning.
CN109558483B (en) A Rumor Recognition Method Based on Naive Bayesian Model
CN116822569A (en) Model training method, device, related equipment and storage medium
Nie et al. A multi-seed nodes selection strategy for influence maximization based on reinforcement learning algorithms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant