Adoption of Back Propagation Network Improved by Particle Swarm Optimization in Network Intrusion Detection

In order to scientifically and reasonably solve some problems in the existing intrusion detection system and effectively maintain the security of network information, the improved particle swarm optimization (PSO) algorithm and back propagation (BP) neural network are used to form a new algorithm to optimize the intrusion detection technology. First, the traditional PSO algorithm is improved, and it is used to optimize the BP neural network. Then the fused new algorithm is adopted to establish an intrusion detection model. Finally, the detection effect of the new model is verified through the experiment. The results show that the detection rate of the intrusion detection model for network attacks can be as high as 93.31%, and it also greatly reduces the false positive rate of the system, which can be as low as 1.85% and has a high practical application value. This study has important reference value for the application of BP neural network improved by PSO in network security.


Introduction
In today's society, computer technology and network communication are developing rapidly, which brings great convenience to production and life. At the same time, the entire society has become more dependent on it. The network itself has the characteristics of openness and freedom, and it is easy to be invaded by criminals. Once user information is stolen, it will cause social chaos. Therefore, in order to ensure the orderly operation of the entire society, maintaining network information security is very important. But nowadays, network security can't be well guaranteed. Malicious attacks and destruction of computer networks by viruses, hackers, etc. have caused serious harm and losses to individuals and society, which makes network security an important issue to be resolved. It is important to meet the needs of China's contemporary national conditions [1].
To solve network security problems, the most important part is the optimization and improvement of intrusion detection technology. For this, many foreign and domestic studies have been made [2]. Some scholars first proposed a general detection model with increased defense functions, but it is not limited by the detection object and specific environment; some scholars have proposed a detection method that is independent of the operating system and platform, but this method requires an intrusion detection system as an intermediary; some scholars have proposed heuristic detection methods and applied them to the security prevention and control of national computer networks; others have applied genetic algorithms to detection technologies and generated specific intrusion library, etc. Although the predecessors have made optimizations and improvements in many aspects, at present, the detection technology still has certain defects, such as the need to improve the detection efficiency, the inability to accurately detect the changing attack characteristics, and the susceptibility to false negatives and false positives. [3]. Therefore, in a complex and ever-changing network environment, improving real-time detection capabilities has become a critical issue.
In summary, first, the existing PSO algorithm (PSO) is improved and applied to the optimization of BP neural network. Then, the newly fused algorithm plays a role in the improvement of the intrusion detection model after various simulation experiments. This study provides an important reference for the update of intrusion detection technology.

Improvement of PSO algorithm-MPSO algorithm
PSO is an algorithm proposed by scientists inspired by the behavior of bird groups. It is a simplification of social models and is used to solve optimization problems [4]. In a space, a group of birds searching for food is considered as a whole, then each bird is a particle, which is a result of the algorithm, and the position of the food is exactly where these particles are looking, That is the optimal result to be achieved by the algorithm. In this space, there is only one such optimal result. The role of the algorithm is to search for this optimal value through screening. In the algorithm, the fitness value of each particle is determined by the corresponding function, and the direction and distance of its movement are also determined by the corresponding speed. The particles obtain the optimal result in an iterative manner.
However, although the traditional PSO algorithm is easy to operate and convenient to implement, it will fall into the cycle of individual optimal results prematurely, and it is difficult to obtain the global optimal value, which does not play a better role in optimization [5]. To solve this problem, the traditional PSO algorithm is improved to obtain a new algorithm-MPSO algorithm. The specific process is shown in figure 1.
In equation (1), k id v represents the speed of particle i when iterating k times in the d dimension, it is subject to certain restrictions and cannot exceed a specific range. k id p represents the component of particle i's own extreme value in the d-th dimension, and k gd p represents the component of the global optimal value in the d-th dimension. c1and c2are ordinary constants, 1 k rand and 2 k rand take values between 0 and 1, respectively, and cannot exceed the range. 1 1 x denotes the position of particle I when it iterates k times in the d dimension. Similar to k id v , it's also subject to certain limits.
Equation (3) is the nonlinear equation of w. In the equation, k represents the number of iterations, and the maximum number of iterations is represented by max k . w is used to maintain the inertia of the particle movement, its initial inertia value is represented by max w , and when the maximum number of iterations is reached, its inertia value is represented by min w , the number of iterations is negatively correlated with the inertia value. By constantly updating the speed and position of the particles, the global optimal value is finally searched.
In equation (4), N represents the total number of particles in the particle group, i f represents the fitness value of particlesi, and avg f represents the average fitness of the particle group. 2  refers to the overall fitness variance of the particle group.
Equation (5) indicates the range and requirements of f.
Equation (6) is used to mutate the global extremum. Among them, k d avg refers to the average position of particles after k iterations in the d dimension.
Substituting the above equation into the process, the complete process of the improved MPSO algorithm can be observed. The improved algorithm has made a reasonable response to the "premature convergence" phenomenon that is prone to occur in the traditional PSO algorithm. Its specific practicality and effectiveness will be tested and verified byAckley functionin the later period. The Ackley function is as follows.

Optimization of BP network by improved algorithm-MPSO_BP neural network
A simple model established by simulating the operation process and working mechanism of the human brain is an artificial neural network. It is good at network learning, and has similarity with the animal's nervous system, which can make it play an ideal role through manual training [6]. The BP neural network was proposed by scientists Rumelhart, McClelland, etc. in 1986. It is a multi-layer feedforward neural network trained according to the error back propagation algorithm, which is currently widely used. There is a corresponding connection between each node of the artificial neural network, which can be used to predict the output information of the network. This makes up for some of the shortcomings of the previous intelligent methods. Due to its nonlinear adaptability in information processing, it has been widely used in prediction, control, and other aspects. However, it still has some shortcomings. The existing prediction ability cannot accurately search for the global optimal value, and due to the inaccurate selection of the threshold, it is easy to cause false positives and false negatives. In this case, scientists began to incorporate evolutionary computing in the training of neural networks, and used their excellent global convergence capabilities to optimize neural networks [7].
However, traditional algorithms are prone to prematurely fall into local optimal values and appear "premature convergence" phenomenon. Therefore, this study is dedicated to improving the efficiency and accuracy of algorithm convergence and uses the improved PSO algorithm-MPSO algorithm to optimize the BP neural network to make up for its shortcomings to get a new fusion optimization algorithm-MPSO_BP algorithm. The process is shown in figure 2.  Figure. 2 The flow chart of MPSO_BP optimization algorithm.

Application of MPSO_BP neural network in intrusion detection technology-MPBIDS model
After the traditional PSO algorithm is improved to obtain the MPSO algorithm, it is used for the optimization of the BP neural network and merged into a new algorithm MPSO_BP algorithm. On this basis, a new intrusion detection model-MPBIDS model is established. The model is devoted to solving the problems of low detection efficiency of existing intrusion detection systems, and inability to monitor in real time and update databases autonomously. The specific process of the model is shown in figure 3.  Among them, MPSO_BP neural network module is the core of the entire intrusion detection model, which is responsible for the processing of the received data, development of new rules libraries, etc.

Optimization performance verification and result analysis of MPSO algorithm
In order to analyze and verify the performance of the improved MPSO algorithm, the Ackley function is used to test it and compare it with the traditional PSO algorithm results. The test results are shown in figure 4. It can be concluded from the figure that when the number of particle iterations is the same, the convergence speed of the MPSO algorithm is much faster than that of the traditional PSO algorithm, which proves that the improved algorithm corrects the defects of the previous strategy and enhances the global search ability of the PSO algorithm, which is slightly better than the traditional algorithm in terms of rapid convergence and effective.

Simulation experiment and result analysis of MPSO_BP neural network
In order to verify the optimization performance of MPSO_BP neural network, the Iris classification problem is used to optimize BP neural network, BP neural network optimized by PSO algorithm, and BP neural network optimized by MPSO algorithm The neural network is tested and the results are simulated using MATLAB. The test results are as follows. It can be concluded from the data in the table 1 that when other conditions are the same under the same experimental environment, the average number of iterations of BP neural network optimized by MPSO Algorithm is the least. In addition, the error during training and testing is also reduced compared to the other two neural networks, which shows that compared with BP neural network and PSO_BP neural network, MPSO_BP neural network has obvious advantages in both converging speed and accuracy. Therefore, its optimization effect is still obvious.

Performance test and result analysis of MPBIDS model
In order to test the performance of MPBIDS model, a single neural network detection model is used to verify it. The experiment selects sample data of four types of attacks and sends them to BP neural network, PSO_BP Neural Network, and MPSO_BP Neural Network. After detection, the detection rate and false positive rate are detected. The test results are shown in figure 5. According to the figure, the MPSO_BP neural network is better than the traditional intrusion detection model for the same type of attack, and the MPSO_BP neural network is more effective than the traditional intrusion detection model, which is in line with the research purpose of this experiment. which shows that it is correct to apply theMPSO_BP algorithm to the intrusion detection model, the model has played a large role in network attack intrusion detection, self-learning, and real-time update, and can be used for reference in theoretical research and practical operations.

Conclusion
Nowadays, network security has attracted much attention, and the enhancement of intrusion detection technology is crucial. In the analysis of traditional intrusion detection technology, the existing foreign and domestic research results are absorbed, and the technical loopholes and deficiencies are summarized. In response to these defects, the PSO algorithm is combined with the neural network algorithm to optimize and improve the intrusion detection technology, and establish a new intrusion detection model. MPBIDS model based on MPSO_BP neural network is found to be effective for improving the detection speed and accuracy, with a detection rate as high as 93.31% and a false positive rate as low as 1.85%. This study proves that the BP neural network optimized by PSO is comprehensive, real-time, and effective in intrusion detection technology and network security. However, in the continuous development of the neural network research process, the findings in this study still have some shortcomings and limitations. Subsequent research should integrate intrusion detection technology with other network security technologies as much as possible to establish a three-dimensional Functional network security defense system.