A network intrusion detection method based on variational autoencoder and deep echo state
The combination of the variational autoencoder generation of balanced samples and the deep echo state network model solves the problem of sample imbalance and complex model training in industrial anomaly intrusion detection, and achieves efficient intrusion detection performance.
Patent Information
- Application Number
- CN202111638957.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing industrial anomaly intrusion detection methods have problems such as sample imbalance leading to low detection rate and complex model training leading to excessive detection time.
A variational autoencoder is used to augment a few types of samples in the data set, and a deep echo state network (D-IDS) model is used to extract potential features through multi-layer reserve pools, simplifying the training process and improving the detection rate.
By generating simulation data, balancing samples and optimizing the network structure and hyperparameters of the D-IDS model, the detection accuracy and detection rate are significantly improved, while shortening the training time, which is better than other mainstream algorithms.
Smart Images

Figure CN114491511B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an industrial control network intrusion detection method, in particular to an industrial intrusion detection method based on a variational autoencoder and a deep echo state network. Background Art
[0002] Cyber attacks by hackers against industrial control systems (ICS) threaten national security. Industrial control networks (ICN) are an important part of industrial control systems. The development of information technology has brought convenience to people, but it has also brought security challenges. Early industrial control systems only focused on practicality and stability, and must ensure long-term uninterrupted operation. Interrupting these systems just for security updates will cause economic losses and affect work efficiency. For example, in urban power systems, a short power outage may affect the daily lives of tens of thousands of people. Industrial control systems are the core of national infrastructure. Once attacked, they will cause economic losses and affect work efficiency. It is particularly important to detect abnormal network traffic in a timely and accurate manner.
[0003] In recent years, anomaly-based network intrusion detection methods have attracted the attention of scholars. By collecting and analyzing network traffic in industrial control systems, summarizing the laws of traffic characteristics under normal circumstances, and comparing normal traffic with the traffic to be detected, it is possible to determine whether the system has been attacked. The advantage is that users can obtain more accurate detection results through optimization algorithms.
[0004] At present, while industrial anomaly detection has achieved success, there are still two problems that need to be solved urgently: one is sample imbalance. There are not enough attack samples available for training, resulting in a low detection rate for abnormal samples; the other is that model training is complex. In reality, network traffic transmission speed is very fast, and the detection time of complex intrusion detection algorithms is too slow. Summary of the invention
[0005] The purpose of the present invention is to provide an industrial intrusion detection method based on variational autoencoders and deep echo state networks. The method uses variational autoencoders (VAE) to expand minority class samples in a collected data set. VAE is a deep generative model whose ability to reconstruct the probability density distribution of original input samples can also be used to generate abnormal traffic. To address the problem of low detection rate due to complex model structure, the method is based on a deep echo state network (DESN) intrusion detection method (D-IDS). ESN abandons the back-propagation mechanism, which greatly shortens the training time, and can effectively extract potential features in the data by stacking reserve pools.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] An industrial intrusion detection method based on variational autoencoder and deep echo state network, the method comprising the following steps:
[0008] Step 1: Preprocess the intrusion detection dataset and divide it into a training set and a test set;
[0009] Step 2: Use the probability generation characteristics of the variational autoencoder to generate minority attack samples, add them to the training set to balance the sample distribution, and do not add any samples to the test set;
[0010] Step 3: Build a deep echo state model, pass the training set into the deep echo state network model, use the multi-layer reserve pool to effectively extract the potential features of the data, and the output layer outputs the predicted values of the samples in different categories;
[0011] Step 4: Set the loss function to calculate the difference between the predicted value and the true value, use the gradient descent algorithm to update the network parameters, and save the trained deep echo state network model;
[0012] Step 5: Pass the test set into the deep echo state network model to complete the classification.
[0013] In the industrial intrusion detection method based on variational autoencoder and deep echo state network, in the hidden layer of the deep echo state network model, the neuron state formula in the reserve pool is:
[0014] At this moment, the first-layer reserve pool is input from the outside Input, each layer of input is provided by the output of the previous layer in the stack, and the number of neurons in each reservoir is , express Moment The neuron state of the layer; the neuron state formula of the first layer reserve pool is as follows:
[0015]
[0016] The neuron state formula of the second layer and subsequent reserve pools is as follows:
[0017]
[0018] in is the input weight matrix, is the internal weight of each layer of the reserve pool, For the Layer and The intra-layer connection weights between layers, For the The leakage parameters of the layer.
[0019] The industrial intrusion detection method based on variational autoencoder and deep echo state network, the output layer of the deep echo state network model is set as follows:
[0020] The output layer uses the fully connected layer in the neural network, and the activation function is set to Softmax; the input of the output layer is the weighted sum of the states of each reservoir pool, that is, the input , the final output dimension of the output layer is the label category.
[0021] The advantages and effects of the present invention are:
[0022] Compared with other industrial abnormal intrusion detection methods, the specific innovation of this invention is that the invention uses variational autoencoders to expand minority class samples in the data set. In view of the complex model training problem, an intrusion detection model D-IDS using a multi-level echo state network is proposed. First, a variational autoencoder is used to generate balanced samples of simulation data, and then the network structure and hyperparameters in the reserve pool of the D-IDS model are analyzed. The optimal parameters are found through a parameter optimization algorithm, and finally compared with other mainstream algorithms. Whether it is training time or intrusion detection performance, the D-IDS model has achieved good results. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic block diagram of the present invention is provided;
[0024] Figure 2 This is the principle diagram of the variational autoencoder;
[0025] Figure 3 This is the schematic diagram of the echo state network;
[0026] Figure 4 This is the schematic diagram of the deep echo state network;
[0027] Figure 5 This is the variational autoencoder network structure diagram;
[0028] Figure 6 This is the training result diagram;
[0029] Figure 7 It is the confusion matrix diagram;
[0030] Figure 8 The accuracy of the model under different network structure settings;
[0031] Fig. 9 is the Loss curve under different leakage parameters;
[0032] Fig.10 Comparison of training time for different algorithms. DETAILED DESCRIPTION
[0033] The present invention will be described in detail below with reference to the embodiments shown in the accompanying drawings.
[0034] VAE is a latent space probabilistic deep generation model, which consists of an encoder and a decoder. When the network is trained, the encoder is responsible for converting the input The high-dimensional feature map of is converted into two low-dimensional vectors to represent the mean and variance of the Gaussian distribution. The mean and variance are reconstructed into a new latent vector , and finally by the hidden vector Generated by decoder During training, the back propagation mechanism of the neural network is used to update the parameters in the network. When data needs to be generated, the decoder inputs two randomly generated numbers that follow a Gaussian distribution to generate data.
[0035] Industrial intrusion detection is different from ordinary network intrusion detection. The detection index requirements are more stringent. Industrial intrusion detection requires high detection rate while ensuring high accuracy. At the same time, in order to adapt to the industrial environment, the model training cannot be too complicated. ESN has strong nonlinear fitting ability and is widely used in the field of time series prediction. As a recursive neural network, its training is much simpler than LSTM, GRU and other networks.
[0036] ESN is a recursive neural network with a reservoir structure proposed by Jaeger et al. in 2001. It consists of a reservoir and a readout layer. The reservoir is usually composed of a large number of neurons. The connections between neurons are random and sparse. Its main function is to map external inputs into a high-dimensional dynamic space to obtain better dynamic performance. The neuron state update equation in the reservoir is as follows:
[0037]
[0038] in and Respectively The external input and neuron state at each moment, is the input weight matrix, is the internal weight of each layer of the reserve pool, is the leakage parameter.
[0039] The readout layer is a linear layer, which is the only trainable part of the entire network. The input is the state obtained from the reservoir. , used to calculate the output of the network. The output is expressed as: ,in express The output of the moment, is the output activation function, is the output weight matrix.
[0040] The improvement of computer computing power enables people to build deeper networks. The ability of a single reservoir to extract features is limited. This paper proposes an intrusion detection algorithm based on a deep echo state network (D-IDS). The characteristic of the D-IDS algorithm is that the reservoir is stacked hierarchically, such as Figure 2 as shown.
[0041] Reserve pool neuron state update settings
[0042] At this moment, the first-layer reserve pool is input from the outside Input, each layer of input is provided by the output of the previous layer in the stack, and the parameter settings in different reservoirs are very flexible. Suppose there is There are 2 pools, and the number of neurons in each pool is , express Moment The neuron state update formula of the first layer of the reserve pool is as follows:
[0043]
[0044] The neuron state update formula of the second layer and subsequent reserve pools is as follows:
[0045]
[0046] in is the input weight matrix, is the internal weight of each layer of the reserve pool, For the Layer and The intra-layer connection weights between layers, For the The leakage parameters of the layer.
[0047] Output layer settings
[0048] Like the standard ESN, the input weight matrix of D-IDS, the connection matrix between each layer, and the cyclic weight matrix inside the reserve pool do not need to be trained after the preset initialization. Only the output layer needs to be trained. In order to simplify the training, the present invention uses the fully connected layer in the neural network as the output layer, and the activation function is set to Softmax. The input of the output layer is the weighted sum of the states of each reserve pool, that is, the input of the final output layer is expressed as The advantage of this setting is that the output layer can accept the motion states of multiple storage pools, and the final output dimension of the output layer is the label category.
[0049] The specific steps are as follows:
[0050] Step 1: Divide the training set and the test set, and perform data preprocessing;
[0051] Step 2: Generate minority attack samples using the probability generation characteristics of the variational autoencoder;
[0052] Step 3: Add the minority attack samples generated in step 2 to the training set in the intrusion detection dataset to complete the expansion of the minority samples and obtain a new training set, while the test set remains the same without adding any samples;
[0053] Step 4: Build a deep echo state model, pass the training set into the deep echo state network model, use the multi-layer reserve pool to effectively extract the internal features of the data, and the output layer outputs the predicted values of the samples in different categories;
[0054] Step 5: The loss function is responsible for calculating the gap between the predicted value and the true value, using the gradient descent algorithm to update the network parameters and save the trained deep echo state network model;
[0055] Step 6: Input the test set for classification;
[0056] Step 7: The classification result of the deep echo state network model is used as the identification result of intrusion detection.
[0057] The following is Example 1:
[0058] Verify the sample generation effect using variational autoencoder
[0059] The operating system used in the experiment is Windows 10 64-bit system, the CPU is Intel I7-10700, the running memory is 8G, and the deep learning framework is tensorflow2.3.
[0060] Experimental data source
[0061] The selected natural gas pipeline dataset comes from the SCADA Security Laboratory of Mississippi State University in 2014
[20] . The laboratory built a natural gas pipeline control system to simulate the natural gas pipeline that transports natural gas or other petroleum products to the market. Researchers collected industrial flow by attacking the system, and finally compiled it by experts. The dataset consists of normal samples and seven types of attack samples. Each sample has 26 features and a label. In order to save training time, 50% of the source data is randomly selected according to the category ratio as the dataset used in the experiment. The dataset is then divided into a training set and a test set at a ratio of 4:1, represented as Data1 and Data2. The labels and corresponding attack categories are described in Table 1.
[0062] Table 1 Dataset description
[0063]
[0064] Data preprocessing
[0065] Irrelevant features with a standard deviation of zero are removed. Since the number of features in the data set is not large, feature selection is not required. In order to eliminate the numerical influence of different features, all remaining features are normalized. Since the relationship between different label categories is mutually exclusive, the labels are one-hot encoded.
[0066] Evaluation indicators
[0067] In order to objectively evaluate the performance of the D-IDS model, the accuracy (ACC), precision (P), detection rate (R) and comprehensive evaluation index (F1-Measure, F) commonly used in the field of intrusion detection are used to evaluate the classification results.
[0068]
[0069] Among them, TP represents the number of correctly identified attack categories, FN represents the number of missed attacks, i.e., the number of incorrectly identified attack categories, FP represents the number of false positives, i.e., the number of incorrectly identified normal categories, and TN represents the number of correctly identified normal categories.
[0070] VAE network structure and parameter setting
[0071] In order to generate data similar to the source data, the hierarchical structure of VAE must be set reasonably. The structure of VAE in the present invention is as follows: all layers use fully connected layers, the number of neurons in the first layer of the encoder is 9, and the second layer is two independent fully connected layers, both derived from the first layer, the number of neurons is 2, the purpose is to use one for calculating the mean and the other for calculating the variance. The hidden variables in the middle , the decoder input is , the number of neurons in the first output layer is 9, and the number of neurons in the second layer is the input dimension.
[0072] The construction of the loss function can be divided into two parts, one is responsible for calculating the error between the input data and the generated data, and the other is responsible for calculating the KL divergence. The optimizer of the variational autoencoder is Adam, the learning rate is 0.001, the batch_size is set to 1024, and the training epochs is set to 1000. Use sample data of different categories to train the VAE, save the decoder part in the VAE, and then use a batch of two numbers that follow a normal distribution to send to the decoder to generate simulated data.
[0073] Generate data evaluation
[0074] In the field of image generation, people can rely on their own visual observation to generate images. At present, it is difficult to judge whether the generated data is really reasonable in the field of data generation. In order to prove the effectiveness of the generated data, the Data1 data set is used to train an LSTM network model with a network depth of 3 and 30 neurons in the layer. 2500 samples of each category are selected from the generated data to form a test set with a total of 20,000 samples, denoted as Data3, to verify the effect of the model trained with Data1 on recognizing the simulated data Data3. After 100 cycles of training, the loss rate and accuracy of the LSTM model on the training set are as follows: Figure 6 , the model has reached a deep convergence state.
[0075] By outputting the confusion matrix, we can analyze the classification of the model for the simulation data Data3, such as Figure 7 As shown in the figure, after calculation, the accuracy of the model on the test set is 93.38%, the detection rate is 89.01%, and the f1 value is 89.79%, indicating that the model trained with real data can well identify simulated data, proving that the data samples generated by the variational autoencoder are effective.
[0076] Comparison before and after data enhancement
[0077] Based on the above experiments, some simulated data are added to balance the data set, and only the training set is enhanced, that is, only Data1 is processed. In order to prevent overfitting, a quantity limit is set, and the number of MSCI and MFCI categories in Data1 is increased to 600, and a new data set Data4 is obtained. The above LSTM model is trained using Data1 and Data4 respectively, and the classification results of the model on the test set Data2 are as follows:
[0078] Table 2 Experimental results
[0079]
[0080] The results show that the classification model trained with the enhanced training set performs better on the test set, indicating that after adding a certain number of minority class samples, the model has learned the internal characteristics of the minority class samples and the boundaries between different categories are clearer.
[0081] D-IDS model experiment
[0082] We selected Data4 and Data2 as the training and test sets for subsequent experiments, and began to conduct in-depth research on the D-IDS model, analyzing the performance of the model under different network structures and hyperparameter settings, selecting the optimal parameters, and finally comparing it with the current mainstream algorithms.
[0083] D-IDS network structure and parameter setting
[0084] In the field of deep learning, the setting of network structure directly affects the output results of the model. Generally, deeper network layers can learn more data patterns, but too deep network layers will bring difficulties to training. When setting epoch to 100, batch_size to 1024, output layer to Dense layer, reserve pool activation function to tanh, output layer activation function to softmax, loss function to CategoricalCrossentropy, optimizer to Adam, learning rate to 0.001, fixed leakage parameter a to 0.6, spectral radius to 0.99, 15 different network structures are set. After taking the average value after multiple experiments, the accuracy of the D-IDS model on the natural gas test set under different network structure settings is as follows: Figure 8 shown.
[0085] The results show that when the number of neurons in the reserve pool (Nr) is 10, the model's ability to extract features is limited, and the accuracy on the test set is low, indicating that too few neurons cannot provide sufficient dynamic performance for the model and the learning ability is poor. In terms of network depth, there is no specific pattern in the performance of the model with different Nr numbers. Without considering the case when Nr=10, at first, as the network depth increases, the performance of the model improves, but when the network depth is 4, the model accuracy of Nr=50 and Nr=150 decreases slightly. When the network depth is 5, the model performance of Nr=150 is the best.
[0086] The leakage parameter a determines the response speed of the neurons in the reservoir structure. The larger the value of a, the faster the reservoir responds to the input. When the network depth of D-IDS is fixed to 5 and the number of neurons in the reservoir is 150, four different leakage parameters are set. The loss of D-IDS on the training set under different leakage parameters is as follows: Fig. 9 shown.
[0087] It can be seen that when a is 0.2, the model has no convergence trend in the first 100 cycles, and when a is 0.8, the model has the lowest loss in the 200th cycle.
[0088] Compared with other algorithms, the D-IDS model needs to be optimized. Since this study has not yet adopted the parameter optimization method, the empirical parameter adjustment method is adopted. Combined with the results of the previous experiments, the network depth of the D-IDS model is selected as 5, the number of neurons in the reserve pool is 150, and the leakage parameter a inside the reserve pool is set to 0.8. The final selected D-IDS parameters are summarized in Table 3.
[0089] Table 3 Optimal parameter settings
[0090]
[0091] Comparative experimental analysis
[0092] In order to prove the superiority of D-IDS algorithm in industrial intrusion detection, comparative experiments are set up to compare with other classic models, all using the same data set and the same data processing method. After taking the average value after multiple experiments, the results are summarized in Tables 4 and 5.
[0093] Table 4 Comparison of precision of different methods
[0094]
[0095] Table 5 Comparison of detection rates of different methods
[0096]
[0097] As shown in Tables 4 and 5, the accuracy of D-IDS for Normal samples is 99.15%, which is significantly higher than other algorithms. For the detection results of the NMRI (simple malicious response injection) attack category, the performance of various algorithms is not very good. Although the accuracy of 1d_CNN and SVM algorithms in this type of attack reaches 100%, their corresponding detection rates are all 0. By consulting the report of this data set, it is found that this attack method will make the feature Measurement (measurement value) far higher than 100 or lower than -1, which seriously deviates from the normal operation value. Only D-IDS learns the boundary between this type of attack and other categories, and its detection rate reaches 90.24% while maintaining high accuracy. In addition, the accuracy of D-IDS for CMRI samples and MSCI samples reached 99.26% and 98.00%, both of which are the best in the same category. D-IDS's detection results for other categories are also excellent.
[0098] In order to verify that the D-IDS model will not affect the training difficulty due to the increase of network depth, it is compared with the 1d-CNN algorithm and LSTM algorithm in the field of deep learning. The results are as follows Fig.10 shown.
[0099] Depend on Fig.10 It can be seen that among the three algorithms, D-IDS has the lowest growth rate. The LSTM algorithm has slow training because the calculation of each time step depends on the result of the previous time step. The 1d-CNN algorithm has a lower training time due to the mechanism of its convolution kernel. D-IDS has achieved the shortest time consumption at different network depths.
[0100] In order to solve the problem of sample imbalance, the present invention adopts variational autoencoder to expand the minority class samples in the data set, and proposes an intrusion detection model D-IDS using a multi-level echo state network to solve the problem of complex model training. First, the variational autoencoder is used to generate balanced samples of simulation data, and then the network structure and hyperparameters in the reserve pool of the D-IDS model are analyzed, and the optimal parameters are found through the parameter optimization algorithm. Finally, the D-IDS model is compared with other mainstream algorithms. Whether it is training time or intrusion detection performance, it has achieved good results.
[0101] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An industrial intrusion detection method based on variational autoencoder and deep echo state network, characterized in that: The method comprises the following steps: Step 1: preprocess the intrusion detection data set and divide it into a training set and a test set; the intrusion detection data set is industrial traffic collected after the control system is attacked. The data set consists of normal samples and seven types of attack samples, and each sample has 26 features and one label; Step 2: Use the probability generation characteristics of the variational autoencoder to generate minority attack samples, add them to the training set to balance the sample distribution, and do not add any samples to the test set; Step 3: Build a deep echo state model, pass the training set into the deep echo state network model, use the multi-layer reserve pool to effectively extract the potential features of the data, and the output layer outputs the predicted values of the samples in different categories; Step 4: Set the loss function to calculate the difference between the predicted value and the true value, use the gradient descent algorithm to update the network parameters, and save the trained deep echo state network model; Step 5: Pass the test set into the deep echo state network model to complete the classification; In the hidden layer of the deep echo state network model, the neuron state formula in the reserve pool is: At time t, the first layer of the reservoir is fed by external input u(t), and each subsequent layer of input is provided by the output of the previous layer in the stack. The number of neurons in each reservoir is N R , represents the neuron state of the lth layer at time t; the neuron state formula of the first layer reserve pool is as follows: The neuron state formula of the second layer and subsequent reserve pools is as follows: in is the input weight matrix, is the internal weight of each layer of the reserve pool, is the internal layer connection weight between layer l and layer l-1, a (l) is the leakage parameter of the lth layer; The output layer of the deep echo state network model is set up as follows: The output layer uses the fully connected layer in the neural network, and the activation function is set to Softmax; the input of the output layer is the weighted sum of the states of each reservoir, that is, the input x(t) = (x (1) (t),x (2) (t),...,x (l) (t))∈R l×NR ,The final output dimension of the output layer is the label category.
