1.Libraries, Hainan Police College, Haikou 570100, China
2.Department of Border Management, Hainan Police College, Haikou 570100, China
3.School of Information Management, Nanjing University, Nanjing 210023, China
Show less
文章历史+
Received
Published
2025-10-23
2026-07-25
Issue Date
2026-09-16
PDF (2516K)
摘要
针对现有网络安全态势评估方法在处理少样本攻击检测精度不足、鲁棒性较差等问题上的局限性,本文提出了一种融合生成对抗网络(Generative Adversarial Networks,GAN)与混合采样(Hybrid Sampling,HS)策略的网络攻击检测方法(GAN-HS)。该方法充分利用GAN在高质量样本生成方面的优势,通过生成器模拟潜在的攻击样本分布,生成伪攻击样本以有效补充和增强少样本数据,从而提升模型对真实且未见样本的检测能力。为应对数据严重不平衡问题,本文还引入了混合采样策略,将GAN生成的伪数据与真实样本有机结合,改善训练数据的分布情况,提高对罕见攻击类型的检测性能。此外,本文在训练过程中采用动态损失函数对网络权重进行自适应调节,使得模型在多类别攻击场景下能够更好地捕捉关键特征,从而提升整体鲁棒性和泛化能力。实验结果表明,与传统方法相比,所提出GAN-HS方法在NSL-KDD(Network Security Laboratory-knowledge Discovery and Data Mining)和CSE-CIC-IDS 2018(Communications Security Establishment & Canadian Institute for Cybersecurity-intrusion Detection System 2018)数据集上F1值较最优基线在二分类上分别提高了3.27%和2.42%,在多分类上分别提高了4.37%和4.99%。特别是在罕见攻击检测中展现出明显优势,由此实现了更全面、实时的网络安全态势评估,也为网络安全监测和预警提供了新的技术思路。
Abstract
Aiming at the limitations of existing network security situation assessment methods in dealing with the problems of insufficient detection accuracy and poor robustness of few sample attacks, this paper proposes a network attack detection method based on generative adversarial networks (GAN) and hybrid sampling (HS) strategy (GAN-HS). This method makes full use of the advantages of GAN in high-quality sample generation, simulates the distribution of potential attack samples through the generator, and generates fake attack samples to effectively supplement and enhance the few-shot data, so as to improve the detection ability of the model for real and unseen samples. In order to deal with the problem of serious data imbalance, this paper also introduces a mixed sampling strategy, which organically combines the fake data generated by GAN with real samples to improve the distribution of training data and improve the detection performance of rare attack types. In addition, a dynamic loss function is used to adaptively adjust the network weights during the training process, so that the model can better capture the key features in multi-class attack scenarios, thereby improving the overall robustness and generalization ability. The proposed GAN-HS method is tested in NSL-KDD (Network security laboratory-knowledge discovery and data mining) and CSE-CIC-IDS 2018 (Communications security establishment & Canadian Institute for Cybersecurity-intrusion detection system 2018) dataset. Experimental results show that compared with traditional methods, the F1 score of the proposed GAN-HS method is 3.27% and 2.42% higher than the optimal baseline in binary classification, and 4.37% and 4.99% higher than the optimal baseline in multi-classification. In particular, it shows obvious advantages in rare attack detection, which realizes a more comprehensive and real-time network security situation assessment, and also provides a new technical idea for network security monitoring and early warning.
随着数字化与信息化的不断深入发展,网络系统已成为社会各领域的关键基础设施。然而,网络攻击事件频发,手段复杂多样,涉及拒绝服务攻击(Denial of Service,DoS)、远程到本地攻击(Remote to Local,R2L)、用户到根攻击(User to Root,U2R)等多种类型,这些攻击行为会对系统资源和用户数据造成严重威胁[1-2]。网络安全态势评估(Network Security Situation awareness,NSSA)是一种综合性分析方法,旨在通过对网络流量、威胁特征和攻击行为进行检测和分析,实现对当前网络安全状况的实时掌握和趋势预测[3]。NSSA不仅可以识别潜在风险,还能为管理者提供干预措施的决策依据,从而在攻击发生前采取应对策略[4-5]。网络攻击检测通过分析网络流量、系统日志或用户行为等数据,识别异常模式以判断是否存在恶意攻击行为的技术手段。然而,现有的网络攻击检测方法在面对日益庞大的网络流量、快速变化的威胁模式和复杂的多类别攻击时,存在实时响应能力不足、检测率不均衡等问题。此外,随着深度学习技术的引入,尽管分类和检测精度有所提升,但对少见和新型攻击类型的检测能力依旧是研究难点和热点问题[6]。
为解决现有网络安全态势评估方法在少样本攻击检测和泛化性能方面的不足,本研究提出了一种基于生成对抗网络的网络安全态势评估方法。该方法旨在通过生成器构建高质量的伪样本集,提升训练数据的多样性,并结合判别器提高模型对真实攻击样本的判别能力,以增强模型在不平衡数据集上的表现。同时,本研究引入动态权重分配机制,使模型在多类别网络攻击场景中能够灵活调整关注重点。本文开展的研究工作主要包括以下三个方面:首先,构建了基于GAN的网络安全态势评估框架,其中生成器用于生成高质量的伪攻击样本,判别器用于提升模型对真实和伪样本的区分能力;其次,引入混合采样策略,将GAN生成的样本与原始数据和合成过采样技术(Synthetic Minority Oversampling Technique,SMOTE)算法生成的数据结合,缓解数据不平衡问题;再次,设计了动态损失函数,根据不同攻击类型的权重自适应调整损失,以提升多类别分类任务的检测性能;最后,在NSL-KDD(Network Security Laboratory-knowledge Discovery and Data Mining)和CSE-CIC-IDS2018(Communications Security Establishment & Canadian Institute for Cybersecurity-intrusion Detection System 2018)数据集上进行了实验验证,结果表明,所提方法在少样本攻击检测和整体态势评估精度方面优于传统方法,尤其在罕见攻击类型检测中表现出更高的准确率和鲁棒性。
NSL-KDD(Network Security Lab KDD Cup 99)数据集[27]是一个广泛应用于网络入侵检测领域的数据集,用于评估各种入侵检测方法和算法。该数据集是对KDD Cup 1999竞赛数据集的改进版本,旨在提高原始数据集的质量和多样性。NSL-KDD数据集包含四种类型的网络流量:正常流量(Normal)、DOS攻击、U2R攻击和R2L攻击,为网络安全研究提供了多样化的测试数据。NSL-KDD数据集各类别统计如表1所示。
CSE-CIC-IDS2018 on AWS数据集[28]涵盖多种不同类型的攻击场景,包括Infiltration、DoS、DDoS、Bot和FTP-BruteForce等。数据集包含1 252 835条记录,包含了捕获每台机器的网络流量和系统日志,并使用CICFlow-V3工具从流量中提取了80个特征,提供了丰富的特征信息用于网络安全检测研究。CSE-CIC-IDS2018 on AWS数据集各类别统计如表2所示。
ChenZ H. Research on Internet Security Situation Awareness Prediction Technology Based on Improved RBF Neural Network Algorithm[J]. J Comput Cogn Eng, 2022, 1(3): 103-108. DOI:10.47852/bonviewjcce149145205514 .
[2]
LiuL X, XuP H, FanK F, et al. Research on Application of Knowledge Graph in Industrial Control System Security Situation Awareness and Decision-making: A Survey[J]. Neurocomputing, 2025, 613: 128721. DOI:10.1016/j.neucom.2024.128721 .
[3]
RenY M, FengX J. Application Analysis of Network Security Situational Awareness Model for Asset Information Protection[J]. Ijacsa, 2024, 15(5): 790. DOI:10.14569/ijacsa.2024.0150579 .
WeiH J, HuZ G. The Research on Intelligent Detection Technology and Countermeasures for Botnet DGA Attacks[J]. J Shanxi Univ Nat Sci Ed, 2025, 48(4): 725-740. DOI:10.13451/j.sxu.ns.2025018 .
[6]
LiW, LiJ J, ZhangC T, et al. A Priori Algorithm Based Network Security Situational Awareness Multi-source Data Correlation Analysis Method[J]. J Cyber Secur Mobil, 2023, 12(6): 869-892. DOI:10.13052/jcsm2245-1439.1263 .
XiR R, YunX C, ZhangY Z, et al. An Improved Quantitative Evaluation Method for Network Security[J]. Chin J Comput, 2015, 38(4): 749-758. DOI: 10.3724/SP.J.1016.2015.00749 .
[9]
WangJ K, ZhangD, GaoH J. Structure and Key Technologies of Nuclear Power Plant Network Security Situational Awareness Platform[C]//Proceedings of the 8th International Conference on Cyber Security and Information Engineering. New York: ACM, 2023: 15-22.. DOI:10.1145/3617184.3617187 .
ZhangH B, YinY, ZhaoD M, et al. Network Security Situational Awareness Model Based on Threat Intelligence[J]. J Commun, 2021, 42(6): 182-194. DOI:10.11959/j.issn.1000-436x.2021106 .
[12]
DongG S, LiW C, WangS W, et al. The Assessment Method of Network Security Situation Based on Improved BP Neural Network[C]//The 8th International Conference on Computer Engineering and Networks (CENet2018). Cham: Springer International Publishing, 2019: 67-76. DOI:10.1007/978-3-030-14680-1_9 .
[13]
ZhaoX L, XuH, WangT, et al. Research on Multidimensional System Security Assessment Based on AHP and Gray Correlation[M]//Trusted Computing and Information Security. Singapore: Springer Singapore, 2020: 177-192. DOI:10.1007/978-981-15-3418-8_13 .
[14]
AlaliM, AlmogrenA, HassanM M, et al. Improving Risk Assessment Model of Cyber Security Using Fuzzy Logic Inference System[J]. Comput Secur, 2018, 74: 323-339. DOI:10.1016/j.cose.2017.09.011 .
[15]
ZhangS C, FuZ Y, AnD Z, et al. Network Security Situation Assessment Based on BKA and Cross Dual-channel[J]. J Supercomput, 2025, 81(3): 461. DOI:10.1007/s11227-025-06932-5 .
[16]
HuJ J, MaD Y, LiuC, et al. Network Security Situation Prediction Based on MR-SVM[J]. IEEE Access, 2019, 7: 130937-130945. DOI:10.1109/ACCESS.2019.2939490 .
[17]
SalemM, TaheriS, YuanJ S. Anomaly Generation Using Generative Adversarial Networks in Host-based Intrusion Detection[C]//2018 9th IEEE Annual Ubiquitous Computing, Electronics & Mobile Communication Conference (UEMCON). New York: IEEE, 2019: 683-687. DOI:10.1109/UEMCON.2018.8796769 .
[18]
HaraK, ShiomotoK. Intrusion Detection System Using Semi-supervised Learning with Adversarial Auto-encoder[C]//NOMS 2020-2020 IEEE/IFIP Network Operations and Management Symposium. New York: IEEE, 2020: 1-8. DOI:10.1109/NOMS47738.2020.9110343 .
[19]
RajkumarM, KarthikaJ, AbinayaaS S. Multi-view Consistent Generative Adversarial Network for Enhancing Intrusion Detection with Prevention Systems in Mobile Ad Hoc Networks Against Security Attacks[J]. Comput Secur, 2025, 150: 104242. DOI:10.1016/j.cose.2024.104242 .
[20]
TanQ L. Deep Learning-driven Network Security Situation Awareness Method in 6G Environment[J]. Internet Technol Lett, 2025, 8(2): e70006. DOI:10.1002/itl2.70006 .
[21]
ChenJ, BianH Q, LiangH. A Network Security Situation Prediction Model Enhanced by Multi Head Attention Mechanism[J]. Informatica, 2025, 49(18): 143-156. DOI:10.31449/inf.v49i18.7670 .
[22]
KalutharageC S, LiuX D, ChrysoulasC. Neurosymbolic Learning and Domain Knowledge-driven Explainable AI for Enhanced IoT Network Attack Detection and Response[J]. Comput Secur, 2025, 151: 104318. DOI:10.1016/j.cose.2025.104318 .
[23]
KostasK, JustM, LonesM A. IoTGeM: Generalizable Models for Behaviour-based IoT Attack Detection[J]. Comput Netw, 2025, 270: 111550. DOI:10.1016/j.comnet.2025.111550 .
ZhaoY, GanG. Research on Network Security Situation Prediction Based on Improved GAN[C]//2021 3rd International Conference on Artificial Intelligence and Advanced Manufacture. New York: ACM, 2021: 612-617. DOI:10.1145/3495018.3495128 .
[26]
KhekareG, KumarK P, PrasanthiK N, et al. Optimizing Network Security and Performance through the Integration of Hybrid GAN-RNN Models in SDN-based Access Control and Traffic Engineering[J]. Int J Adv Comput Sci Appl, 2023, 14(12): 596-606. DOI:10.14569/ijacsa.2023.0141262 .
[27]
WangX, JiangH K, ZengT, Et al. An Adaptive Fused Domain-cycling Variational Generative Adversarial Network for Machine Fault Diagnosis under Data Scarcity[J]. Inf Fusion, 2026, 126: 103616. DOI:10.1016/j.inffus.2025.103616 .
[28]
Da Silva RuffoV G, LentD M B, CarvalhoL F, et al. Generative Adversarial Networks to Detect Intrusion and Anomaly in IP Flow-based Networks[J]. Future Gener Comput Syst, 2025, 163: 107531. DOI:10.1016/j.future.2024.107531 .
[29]
BethuS. Malicious Attack Detection in IoT by Generative Adversarial Networks[J]. SN Comput Sci, 2025, 6(4): 372. DOI:10.1007/s42979-025-03874-w .
[30]
MeenaG, ChoudharyR R. A Review Paper on IDS Classification Using KDD 99 and NSL KDD Dataset in WEKA[C]//2017 International Conference on Computer, Communications and Electronics (Comptelix). New York: IEEE, 2017: 553-558. DOI:10.1109/COMPTELIX.2017.8004032 .
[31]
FarhanR I, MaoloodA T, HassanN F. Performance Analysis of Flow-based Attacks Detection on CSE-CIC-IDS2018 Dataset Using Deep Learning[J]. Indones J Electr Eng Comput Sci, 2020, 20(3): 1413. DOI:10.11591/ijeecs.v20.i3.pp1413-1418 .
[32]
LiJ Y, LiY D, SongJ G, et al. Quantum Support Vector Machine for Classifying Noisy Data[J]. IEEE Trans Comput, 2024, 73(9): 2233-2247. DOI:10.1109/TC.2024.3416619 .
[33]
MienyeI D, JereN. A Survey of Decision Trees: Concepts, Algorithms, and Applications[J]. IEEE Access, 2024, 12: 86716-86727. DOI:10.1109/ACCESS.2024.3416838 .
[34]
OrvietoA, ZucchetN. Recurrent Neural Networks: Vanishing and Exploding Gradients Are Not the End of the Story[C]//Advances in Neural Information Processing Systems 37. New Orlean: Curran Associates, Inc., 2024: 139402-139443. DOI:10.52202/079017-4425 .
[35]
LiM, MicheliA, WangY G, et al. Guest Editorial: Deep Neural Networks for Graphs: Theory, Models, Algorithms, and Applications[J]. IEEE Trans Neural Netw Learn Syst, 2024, 35(4): 4367-4372. DOI:10.1109/TNNLS.2024.3371592 .
[36]
DialloR, EdaloC, AweO O. Machine Learning Evaluation of Imbalanced Health Data: a Comparative Analysis of Balanced Accuracy, MCC, and F1 Score[M]//Practical Statistical Learning and Data Science Methods. Cham: Springer Nature Switzerland, 2024: 283-312. DOI:10.1007/978-3-031-72215-8_12 .