| With the rapid development of computer networks and the large-scale commercialization of 5G technology,network security issues are facing increasingly severe tests,and intrusion detection plays an important role in network security,and machine learning algorithms are generally used for intrusion detection.However,the inability to collect traffic data on the latest network attacks and the inconvenience of disclosing confidential data from security departments or enterprises have led to slow updates of intrusion detection datasets,uneven distribution of certain types and inefficient detection,among other factors.To address the above problems,this paper proposes an intrusion detection method based on generative adversarial networks and convolutional neural networks.Generative Adversarial Networks(GAN)is first used to generate intrusion detection data,which increases the amount of data in the original dataset and improves the problem of low amount of certain types of data.Convolutional Neural Networks(CNN)is then improved using the SelfAttention mechanism to improve the correct rate of intrusion detection.First,this paper proposes an intrusion detection data enhancement method based on generative adversarial networks for the problem of unbalanced type distribution of intrusion detection data.The pre-processed intrusion detection dataset is used to train the generative adversarial network to fit the distribution of the original data;the gradient penalty function is also introduced to update the gradient,and the gradient backpropagation updates the network parameters of the generative adversarial network;the trained generative adversarial network model is used to generate the intrusion detection data that meet the requirements.The method exploits the powerful data generation capability of generative adversarial networks to generate fake data samples that are similar but not identical to the original data,which in turn expands the intrusion detection dataset.Experiments using the enhanced intrusion detection data,the results of which show that it can improve the uneven distribution of data types to some extent.Mixing the generated data with real data allows for better training of intrusion detection models.Comparing the data enhancement effect of different generative adversarial networks,this method generates higher quality images.Eventually,intrusion detection using the enhanced dataset works better.Then an intrusion detection method based on Self-Attention improved CNN is proposed to the problem that CNN can effectively extract multiple features of image data but cannot discover important features among multiple features.The method balances the various types of data based on the enhancement of the original data using the data enhancement methods described above.Secondly,CNN is used to extract features for each input data and weight these features using the Self-Attention mechanism to highlight important features and attenuate useless features.Finally,the weighted features are classified using Soft Max to classify the corresponding intrusion types.The experimental results show that the method can significantly improve the detection rate of small sample data compared with the convolutional neural network intrusion detection algorithm that does not incorporate an attention mechanism,and it can also improve the overall detection performance. |