CN115396143A - 一种基于bilstm-crf工业入侵检测方法 - Google Patents
一种基于bilstm-crf工业入侵检测方法 Download PDFInfo
- Publication number
- CN115396143A CN115396143A CN202210856731.0A CN202210856731A CN115396143A CN 115396143 A CN115396143 A CN 115396143A CN 202210856731 A CN202210856731 A CN 202210856731A CN 115396143 A CN115396143 A CN 115396143A
- Authority
- CN
- China
- Prior art keywords
- crf
- bilstm
- intrusion detection
- layer
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 45
- 238000012360 testing method Methods 0.000 claims abstract description 5
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 4
- 239000013598 vector Substances 0.000 claims description 13
- 238000004422 calculation algorithm Methods 0.000 claims description 11
- 238000000034 method Methods 0.000 claims description 7
- 238000012549 training Methods 0.000 claims description 7
- 238000013528 artificial neural network Methods 0.000 claims description 6
- 238000007781 pre-processing Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 238000003066 decision tree Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000003064 k means clustering Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000007637 random forest analysis Methods 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000002155 anti-virotic effect Effects 0.000 description 1
- 238000003556 assay Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 230000001010 compromised effect Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1408—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
- H04L63/1416—Event detection, e.g. attack signature detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
一种基于BILSTM‑CRF工业入侵检测方法,涉及一种网络工业入侵检测方法,本发明根据网络入侵的时序性特点提出了一种由双向长短时记忆网络(Bi‑LSTM)和条件随机场(CRF)组成的网络入侵检测模型—BILSTM‑CRF模型。针对原始攻击数据具有离散性且分布较广的问题,对数据进行数值化及归一化的预处理操作,将模型应用在CIC‑IDS2017数据集上进行实验测试,本发明模型对网络入侵检测的多种攻击类别的精确率P和F1值都有提高,而且模型最终准确率更高(99.81%)远高于其他模型,符合网络入侵检测的要求。证明了该模型在工业控制系统实时入侵检测应用中的性能的优越性。
Description
技术领域
本发明涉及工业控制网络入侵检测方法,特别是涉及一种基于BILSTM-CRF工业入侵检测方法。
背景技术
互联网服务已经成为商业交易和个人生活中不可缺少的一部分。随着对网络服务的日益依赖,关键信息的机密性和完整性越来越多地受到远程入侵的损害。企业被迫加强网络防范恶意活动和网络威胁。因此,网络系统必须使用一种或多种安全工具,例如防火墙、杀毒软件或入侵检测系统,以保护重要的数据、服务免受黑客或入侵者的攻击。
因为防火墙无法抵御网络服务所需的开放端口上的入侵企图,所以仅依靠防火墙系统是不足以防止公司网络受到所有类型的网络攻击的。因此,通常需要安装入侵检测系统(IDS)来补充防火墙,入侵检测系统从网络或计算机系统收集信息,并分析这些信息以发现系统入侵的情况。
网络入侵检测一直都是网络安全中亟待解决的问题,传统入侵检测算法存在的检测率低和高误报率问题。
发明内容
本发明的目的在于提供一种基于BILSTM-CRF工业入侵检测方法,本发明解决工控网络入侵传统单一深度学习算法分类模型的分类准确率低的问题,使用BILSTM和CRF相结合的BILSTM-CRF提高分类的准确率。
本发明的目的是通过以下技术方案实现的:
一种基于BILSTM-CRF工业入侵检测方法,所述方法包括以下步骤:
步骤1:对入侵检测数据集进行数据预处理,将其划分为训练集与测试集;
步骤2:对网络中采集到的原始数据流量进行预处理;
步骤3:搭建BILSTM-CRF网络模型,将训练集传入BILSTM-CRF网络模型,输出层输出样本在不同类别上的预测值;
步骤4:利用MLP分类器就可以实现入侵检测的分类任务;处理好的数据分别通过两个全连接层和一个Dropout层,最后通过Softmax函数输出。
所述的一种基于BILSTM-CRF工业入侵检测方法,所述方法使用双向(前向、后向)LSTM耦合CRF作为输出层的神经网络的配置。
所述的一种基于BILSTM-CRF工业入侵检测方法,所述方法每个时间步的输入是一个数据,它被数据嵌入层转换为数据向量,除了数据向量之外,输入层还可以有选择地采用额外的基于数据的特征来利用特征表示。
所述的一种基于BILSTM-CRF工业入侵检测方法,所述在LSTM的前向和后向两层中分别放置表面的拼接嵌入向量和附加特征;对于每个时间步,前向LSTM和后向LSTM的输出被连接并发送到隐藏层;与隐藏层完全连通的输出给出了标签对应的多类概率信息;最后,将网元标签在整个数据序列上的概率信息放入CRF层,以估计整个文本序列上的最优网元标签序列。
所述的一种基于BILSTM-CRF工业入侵检测方法,所述CRF层估计每个数据位置的标签,通过Viterbi算法共同最大化标签序列;连接BILSTM层和CRF层形成完整的BILSTM-CRF模型。
本发明的优点与效果是:
本发明相较于其他工业异常入侵检测方法,具体的提升之处在于,针对日益严重的工业信息安全问题,本发明根据网络入侵的时序性特点提出了一种由双向长短时记忆网络(Bi-LSTM)和条件随机场(CRF)组成的网络入侵检测模型—BILSTM-CRF模型。使用新布伦瑞克大学(UNB)加拿大网络安全研究所(CIC)的公共数据集CICIDS2017进行实验,实验结果证明,本发明模型相对于传统机器学习模型,对网络入侵检测的多种攻击类别的精确率P和F1值都有提高,而且模型最终准确率更高(99.81%)远高于其他模型,符合网络入侵检测的要求。证明了该模型在工业控制系统实时入侵检测应用中的性能的优越性。
附图说明
图1为本发明方法步骤示意图;
图2为BILSTM网络结构原理图;
图3为 BILSTM-CRF网络模型原理图。
具体实施方式
下面结合附图所示实施例对本发明进行详细说明。
递归神经网络(RNN)可以基于历史信息的时序性处理,这使它们在有时序性数据时有其天然的优势。但是由于梯度消失和梯度爆炸问题,RNN会产生长期依赖等问题。LSTM是专门设计用来解决长期依赖问题的内存单元。它主要由三种类型的门结构组成,控制在细胞状态下要忘记和存储的信息的比例。对于时序性数据的提取任务,如果访问给定时间的过去和未来的数据信息,我们可以利用更多级别的信息做出更好的预测。但是LSTM无法编码从后到前的信息。而BILSTM则能够将信息正序和倒序结合之后进行编码良好的解决了无法从前到后编码的问题。具体结构如图2。CRF的主要优点是它可以包含丰富的、重叠的特性。它融合了观测间的依赖关系,旨在解决远距离依赖问题。在CRF中,基于丰富的输入和输出向量之间的关系的特征很容易被合并。因此,它不需要在观察上花费建模的精力,而观察在测试时是固定的。此外,标签序列的条件概率可以依赖于观察序列的任意、非独立特征,而无需强迫模型考虑这些特征依赖。
BILSTM-CRF层
CRF层
CRF是最常用的控制结构预测的方法,其基本思想是在给定输入序列的情况下,用一系列势函数近似输出标签序列的条件概率[10]。形式上,我们取上述隐藏状态序列h=作为我们到CRF层的输入,它的输出是我们最终的预测标签序列y =,在所有可能标签的集合中。我们将表示为所有可能的标签序列的集合。然后在给定输入隐状态序列为的条件下,推导出输出序列的条件概率为:
BILSTM-CRF模型
在LSTM的前向和后向两层中分别放置表面的拼接嵌入向量和附加特征。对于每个时间步,前向LSTM和后向LSTM的输出被连接并发送到隐藏层。与隐藏层完全连通的输出给出了标签对应的多类概率信息。最后,将网元标签在整个数据序列上的概率信息放入CRF层,以估计整个文本序列上的最优网元标签序列。CRF层估计每个数据位置的标签,通过Viterbi算法共同最大化标签序列。连接BILSTM层和CRF层形成完整BILSTM-CRF模型,具体结构如图2。
MLP分类器
MLP分类器是一种全连接神经网络,主要有两部分组成,分别是输入层和输出层。通过BILSTM-CRF混合网络对样本数据进行高级的特征提取,只需要MLP这一简单的分类器就可以实现入侵检测的分类任务。首先,处理好的数据分别通过两个全连接层和一个Dropout层,最后通过Softmax函数输出。BILSTM-CRF混合网络的输出结果为P,MLP分计算公式如下:
一种基于BISTM-CRF工业入侵检测方法,其具体步骤如下:
步骤1:对入侵检测数据集进行数据预处理,将其划分为训练集与测试集;
步骤2:对网络中采集到的原始数据流量进行预处理;
步骤3:搭建BILSTM-CRF网络模型,将训练集传入BILSTM-CRF网络模型,输出层输出样本在不同类别上的预测值;
步骤4:利用MLP分类器就可以实现入侵检测的分类任务。处理好的数据分别通过两个全连接层和一个Dropout层,最后通过Softmax函数输出;
实施例1:
实验所使用的操作系统为windows10 64位系统,CPU为Intel I7-10700,运行内存8g,深度学习框架为tensorflow2.7。
实验数据来源
使用的是新布伦瑞克大学(UNB)加拿大网络安全研究所(CIC)的公共数据集进行入侵检测(IDS)任务。CICIDS2017数据集包含310万条流量记录。在去掉不完整的记录之后,仍有大约290万笔流动数据。新布伦瑞克大学加拿大网络安全研究所还提供了CICIDS2017的完整数据包捕获,但这些数据并没有用于本论文。对84个连续型特征进行min-max归一化,对数据集样本标签进行One-Hot编码,预处理后数据集描述如表1所示。
表1 数据集描述
评价指标
为了客观的评价D-IDS模型的性能,采用入侵检测领域中常用的准确率(Accuracy,ACC)、精确率(Precision,P)、检出率(Recall,R)和综合评价指标(F1-Measure,F)来评价分类结果。
其中,TP 表示正确识别的攻击类别数目,FN 表示漏报即未正确识别攻击类别的数目,FP 表示误报即错误识别正常类别的数目,TN 表示正确识别的正常类别数目。
参数设置
为了得到更好的实验结果,BILSTM-CRF模型的一次迭代输入模型样本适量BATCH-SIZE=500,抛出率Dropout-rate=0.5,全部样本训练次数EPOCHS=20,初始化学习率LR=0.001,优化函数使用Adam。
对比算法
在入侵检测模型中,比较常用的机器学习算法包括人工神经网络(ArtificialNeural Network , ANN )、决策树(Decision Tree , DT)、K最近邻(K-Nearest Neighbor, KNN)、朴素贝叶斯(Naive Bayes , NB)、随机森林(Random Forest , RF)、支持向量机(Support vector machine , SVM)、k均值聚类算法(k-means clustering algorithm , K-MEANS)、最大期望算法(Expectation-Maximization algorithm , EM)、自组织映射(Self-organizing Maps , SOM)。 使用这些常用算法建立入侵检测模型,对CICIDS2017数据集进行检测,不同机器学习模型检测结果对比如图表2所示
表2 不同模型检测对比
Claims (5)
1.一种基于BILSTM-CRF工业入侵检测方法,其特征在于,所述方法包括以下步骤:
步骤1:对入侵检测数据集进行数据预处理,将其划分为训练集与测试集;
步骤2:对网络中采集到的原始数据流量进行预处理;
步骤3:搭建BILSTM-CRF网络模型,将训练集传入BILSTM-CRF网络模型,输出层输出样本在不同类别上的预测值;
步骤4:利用MLP分类器就可以实现入侵检测的分类任务;处理好的数据分别通过两个全连接层和一个Dropout层,最后通过Softmax函数输出。
2.根据权利要求1所述的一种基于BILSTM-CRF工业入侵检测方法,其特征在于,所述方法使用双向(前向、后向)LSTM耦合CRF作为输出层的神经网络的配置。
3.根据权利要求1所述的一种基于BILSTM-CRF工业入侵检测方法,其特征在于,所述方法每个时间步的输入是一个数据,它被数据嵌入层转换为数据向量,除了数据向量之外,输入层还可以有选择地采用额外的基于数据的特征来利用特征表示。
4.根据权利要求1所述的一种基于BILSTM-CRF工业入侵检测方法,其特征在于,所述在LSTM的前向和后向两层中分别放置表面的拼接嵌入向量和附加特征;对于每个时间步,前向LSTM和后向LSTM的输出被连接并发送到隐藏层;与隐藏层完全连通的输出给出了标签对应的多类概率信息;最后,将网元标签在整个数据序列上的概率信息放入CRF层,以估计整个文本序列上的最优网元标签序列。
5.根据权利要求1所述的一种基于BILSTM-CRF工业入侵检测方法,其特征在于,所述CRF层估计每个数据位置的标签,通过Viterbi算法共同最大化标签序列;连接BILSTM层和CRF层形成完整的BILSTM-CRF模型。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210856731.0A CN115396143A (zh) | 2022-07-21 | 2022-07-21 | 一种基于bilstm-crf工业入侵检测方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210856731.0A CN115396143A (zh) | 2022-07-21 | 2022-07-21 | 一种基于bilstm-crf工业入侵检测方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115396143A true CN115396143A (zh) | 2022-11-25 |
Family
ID=84116802
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210856731.0A Pending CN115396143A (zh) | 2022-07-21 | 2022-07-21 | 一种基于bilstm-crf工业入侵检测方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115396143A (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117455497A (zh) * | 2023-11-12 | 2024-01-26 | 北京营加品牌管理有限公司 | 一种交易风险检测方法及装置 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111783464A (zh) * | 2020-06-29 | 2020-10-16 | 中国电力科学研究院有限公司 | 一种面向电力的领域实体识别方法、系统及存储介质 |
CN112163099A (zh) * | 2020-09-24 | 2021-01-01 | 平安直通咨询有限公司上海分公司 | 基于知识图谱的文本识别方法、装置、存储介质和服务器 |
CN113518063A (zh) * | 2021-03-01 | 2021-10-19 | 广东工业大学 | 基于数据增强和BiLSTM的网络入侵检测方法及系统 |
-
2022
- 2022-07-21 CN CN202210856731.0A patent/CN115396143A/zh active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111783464A (zh) * | 2020-06-29 | 2020-10-16 | 中国电力科学研究院有限公司 | 一种面向电力的领域实体识别方法、系统及存储介质 |
CN112163099A (zh) * | 2020-09-24 | 2021-01-01 | 平安直通咨询有限公司上海分公司 | 基于知识图谱的文本识别方法、装置、存储介质和服务器 |
CN113518063A (zh) * | 2021-03-01 | 2021-10-19 | 广东工业大学 | 基于数据增强和BiLSTM的网络入侵检测方法及系统 |
Non-Patent Citations (1)
Title |
---|
张若彬等: "基于BLSTM-CRF模型的安全漏洞领域命名实体识别", 《四川大学学报(自然科学版)》, vol. 56, no. 3, 31 May 2019 (2019-05-31), pages 469 - 475 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117455497A (zh) * | 2023-11-12 | 2024-01-26 | 北京营加品牌管理有限公司 | 一种交易风险检测方法及装置 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhou et al. | Siamese neural network based few-shot learning for anomaly detection in industrial cyber-physical systems | |
Khan et al. | Malicious insider attack detection in IoTs using data analytics | |
Sathesh | Enhanced soft computing approaches for intrusion detection schemes in social media networks | |
Wagh et al. | Survey on intrusion detection system using machine learning techniques | |
CN108400895B (zh) | 一种基于遗传算法改进的bp神经网络安全态势评估算法 | |
Gwon et al. | Network intrusion detection based on LSTM and feature embedding | |
Zhang et al. | POSTER: A PU learning based system for potential malicious URL detection | |
CN111598179B (zh) | 电力监控系统用户异常行为分析方法、存储介质和设备 | |
CN111652290A (zh) | 一种对抗样本的检测方法及装置 | |
Lu et al. | Black-box attacks against log anomaly detection with adversarial examples | |
CN115396143A (zh) | 一种基于bilstm-crf工业入侵检测方法 | |
Long et al. | Autoencoder ensembles for network intrusion detection | |
Kumar et al. | Privacy Preserving Blockchain with Optimal Deep Learning Model for Smart Cities. | |
Soewu et al. | Analysis of Data Mining-Based Approach for Intrusion Detection System | |
Shen et al. | RP-NBSR: A Novel Network Attack Detection Model Based on Machine Learning. | |
Wang et al. | An efficient intrusion detection model combined bidirectional gated recurrent units with attention mechanism | |
Wu et al. | Intrusion Detection System Using a Distributed Ensemble Design Based Convolutional Neural Network in Fog Computing | |
Abhale et al. | Deep Learning Algorithmic Approach for Operational Anomaly Based Intrusion Detection System in Wireless Sensor Networks | |
Rajora | Reviews research on applying machine learning techniques to reduce false positives for network intrusion detection systems | |
Manikandan et al. | A new data mining based network intrusion detection model | |
Sravanthi et al. | Cyber Threat Detection Based On Artificial Neural Networks Using Event Profiles | |
Kherlenchimeg et al. | A deep learning approach based on sparse autoencoder with long short-term memory for network intrusion detection | |
Altalbe | Enhanced Intrusion Detection in In-Vehicle Networks using Advanced Feature Fusion and Stacking-Enriched Learning | |
Bandyopadhyay et al. | A Decision Tree Based Intrusion Detection System for Identification of Malicious Web Attacks | |
Sangve et al. | ANIDS: anomaly network intrusion detection system using hierarchical clustering technique |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |