Abstract:Network intrusion detection system (NIDS) is one of the key technologies to detect network attacks and protect network security, and it is an important research direction in the field of network security. In recent years, researchers have used machine learning algorithms to complete intrusion detection tasks and achieved good results, but the detection efficiency and accuracy need to be further improved. Based on the experiments and comparative analysis of the characteristics of the whale optimization algorithm (WOA) and the extreme gradient boosting algorithm (XGBoost), the WOA-XGBoost model is proposed. First, a classification model based on XGBoost is constructed, and then the optimal parameters of XGBoost are searched adaptively using the WOA algorithm. Finally evaluate the performance of the proposed WOA-XGBoost model based on the NSL-KDD dataset. Experimental results show that the model outperforms other models such as XGBoost, Random Forest, Adaboost and LightGBM in terms of classification precision, accuracy, recall and AP indicators. This work also provides a basis for the application of swarm intelligence optimization algorithm in network intrusion detection.