| Network intrusion detection can detect whether the computer system is attacked in time,and take corresponding measures against the attack.The current machine learning-based intrusion detection methods with good detection effects still have room for improvement,especially when dealing with unbalanced data sets.Existing machine learning methods usually focus on the overall detection rate,which leads to It ignores detection rates for individual attack classes.Due to the small number of samples for certain types of attacks in imbalanced datasets,the detection rate of these attacks will be very low.In response to the above problems,this paper proposes a CNN-GRUbased intrusion detection model and a data balance idea,which can not only improve the overall detection rate of the model,but also pay attention to the detection rate of minority attacks.The main contents are as follows:First,the convolutional neural network and the gated recurrent unit are applied to intrusion detection.The convolutional neural network performs spatial feature learning,and the gated recurrent unit performs time-series feature learning.The spatial and temporal features of traffic are organically combined to improve The detection ability of the model.Then,a strategy is proposed to address the prevalent data imbalance in intrusion detection datasets.Considering the size of the data set and the number of different types of samples in it,targeted expansion methods are used respectively.The selected improved SMOTE algorithm and conditional generation confrontation network are excellent means of data balance expansion to solve the problem caused by data imbalance.To solve the problem of poor detection effect of minority attacks,improve the detection rate of the model for minority attacks.Then,by setting up multiple groups of experiments,it is determined that the detection content is the first 6 data packets of the session,and the first 128 bytes of data in each data packet.Finally,experiments are carried out on the CIC-IDS dataset to evaluate and analyze the detection model and data balance strategy proposed in this paper.The experimental results show that the intrusion detection model proposed in this paper has good detection ability,the detection accuracy rate reaches 91.7%on the original data set,and the detection accuracy rate increases to 94.3%on the balanced data set,and each The minority attack detection rate has been greatly improved compared to before balance. |