Network security situation element extraction method and system based on hybrid deep learning
By constructing a CNN-LSTM-BP model and combining convolutional neural networks, long short-term memory networks, and backpropagation algorithms, the problem of inaccurate feature extraction in complex network environments by existing technologies is solved, and efficient network security situation element extraction and classification are achieved.
Patent Information
- Application Number
- CN202411133966.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-26
AI Technical Summary
Existing methods for extracting network security situational awareness elements are not ideal in terms of accuracy and efficiency when facing complex and ever-changing network environments, especially when dealing with massive amounts of heterogeneous data and nonlinear network attacks, making it difficult to effectively extract key features.
A security situation element extraction model based on CNN-LSTM-BP is constructed. Local features are extracted by convolutional neural network (CNN), temporal features are processed by long short-term memory network (LSTM), and backpropagation (BP) network is used for classification and optimization. Batch normalization, ReLU activation function and Dropout technology are combined to improve model performance.
It achieved a classification accuracy rate of 97.94%, significantly improving the accuracy and efficiency of extracting network security situation elements, and enabling more effective identification of network threats and abnormal behaviors.
Smart Images

Figure CN119030767A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and system for extracting network security situation elements based on hybrid deep learning. Background Art
[0002] The key to the stable operation of the industrial Internet system is security. In recent years, more and more new technologies have been integrated into the Internet system, bringing high efficiency to the industrial Internet, while a large number of network security issues have also emerged. Massive industrial equipment is ubiquitously connected, and the industrial Internet presents the characteristics of a wide range of involvement, complex data systems, large impact of security incidents, weak corporate security protection foundation, and an increasing number of security vulnerabilities year by year.
[0003] The concept of Cyberspace Situation Awareness (CSA) was first proposed by Tim Bass in 1999. It aims to obtain, understand and display the security factors that cause changes in network situation in large-scale network environments and predict their development trends. The main processes of CSA include data collection, situation factor extraction, situation assessment and prediction. Extracting network security situation factors is the basis for network security situation assessment and prediction. It is necessary to analyze and process various data collected from network security devices, extract factors that affect the normal operation of the network, and classify and identify them according to specific rules, so as to identify different categories of factors that affect network security situation. This real-time security situation awareness can guide decision makers to formulate and implement effective security strategies to ensure the stability and security of enterprise network operations. The quality of the extracted situation factors directly affects the accuracy of situation understanding and assessment prediction, thereby affecting the network administrator's understanding of the security situation of the entire network system and the security measures taken. Therefore, accurate and effective extraction of security situation factors is of great significance to network security situation awareness.
[0004] The extraction of network security situational elements is the basis of network security situation awareness and has become one of the most important research and practice directions in the field of network security. With the rapid development of big data and artificial intelligence technologies, researchers have begun to apply artificial intelligence and machine learning technologies to the field of network security, and research results on intrusion detection and situational element extraction based on intelligent technologies such as machine learning have emerged. Principal Component Analysis (PCA) is an unsupervised learning method that does not require any label information for feature extraction and dimensionality reduction. Therefore, researchers often combine PCA with classifiers to extract situational elements. Existing literature combines PCA with random forest for intrusion detection to improve classification efficiency; existing literature combines PCA with Hotelling's T2 graph to reduce the feature dimension and computational complexity of intrusion classification while maintaining detection accuracy; existing literature uses hybrid recursive neural network to construct an intrusion detection model SPIDER, and uses PCA for feature simplification to reduce data dimension; existing literature combines probabilistic PCA with generalized additive model to simplify features and capture nonlinear relationships, thereby enhancing the understanding of intrusion detection; existing literature proposes a situation extraction mechanism based on logistic regression and improved particle swarm optimization model, adopts nonlinear random decrease strategy of weight value to improve particle swarm algorithm, and uses the inherent implicit parallelism and good global optimization ability of particle swarm algorithm to estimate parameters and optimize learning ability of LR model; existing literature aims at the problem that current network security situation factor extraction method does not consider multi-feature dimensionality reduction situation information, and proposes a network security situation factor extraction method based on multi-feature dimensionality reduction.
[0005] In recent years, with the continuous deepening of deep learning algorithm research, the introduction of deep learning algorithms into situational element extraction has gradually become a research hotspot. The application of deep learning in the field of network intrusion detection is mostly for the detection and identification of malicious attacks, which is essentially a multi-classification task. The existing literature proposes a network security situation element extraction method based on gradient boosting decision tree, which uses the attribute reduction function of rough set to preprocess the original data, and then uses the quantum particle swarm optimization algorithm to optimize the initial parameters of GBDT to improve its stability; the existing literature uses denoising autoencoders to achieve feature dimension compression of intrusion data, and then uses part of the compressed data to train a deep neural network classifier based on a multi-class supervision method. The existing literature proposes an intrusion detection system called AE-LSTM, which uses deep acoustic emission for dimensionality reduction and then uses a hybrid long short-term memory neural network (LSTM) model for network traffic detection. The existing literature uses the fuzzy rough set method to simplify data attributes, and integrates the classifier theory with the particle swarm optimization technology to propose a situation element extraction model based on fuzzy rough set and combined classifier.
[0006] With the rapid development of the industrial Internet, network attacks are increasingly showing characteristics such as randomness and nonlinearity. At the same time, the massive generation of network data and the heterogeneity of data make it more difficult to obtain network security situation elements. The above research work has promoted the development of network security situation element extraction technology, but these research works require a lot of prior knowledge. In the face of the increasingly complex and changeable network environment, their accuracy and efficiency are not ideal. Summary of the invention
[0007] In order to solve the existing problems, the present invention provides a network security situation factor extraction method and system based on hybrid deep learning.
[0008] The present invention adopts the following technical solutions:
[0009] A network security situation factor extraction method based on hybrid deep learning, comprising:
[0010] Constructing a security situation factor extraction model based on CNN-LSTM-BP, the security situation factor extraction model includes a data input module, a convolution module, an LSTM module, a fully connected module, a BP module and an output module; the data input module, the convolution module, the LSTM module, the fully connected module, the BP module and the output module are sequentially data connected;
[0011] Network security situation elements are extracted based on the security situation element extraction model.
[0012] Furthermore, the data input module includes a data preprocessing unit, which is used to perform preprocessing operations on the original training data, and the preprocessing operations include data batching, data classification and data format conversion.
[0013] Furthermore, the convolution module includes a convolution layer and a pooling layer. The input data of the data input module passes through the convolution layer and the pooling layer in sequence to extract the key information of the data; after each convolution layer, a batch normalization layer and a ReLU activation function are added, the batch normalization layer is used to standardize the input of the data, and the ReLU introduces nonlinear characteristics to enable the neural network to learn more complex function mappings.
[0014] Furthermore, before the data output by the convolution module is input into the LSTM module, the View function is used to reshape the data, and then the gating mechanism in the LSTM module is used to extract the time series features to solve the gradient vanishing problem.
[0015] Furthermore, for the fully connected module and the BP module, the last time step in the LSTM module is selected as the input feature of the fully connected module and the BP module, and the input features are predicted and classified. The fully connected module and the BP module will output a tensor data containing logarithmic probability, and the predicted value with the largest probability is selected as the predicted category; and the Dropout function is placed after the fully connected module and the BP module respectively to randomly discard some network connections during the training process to reduce the model's dependence on training data.
[0016] Furthermore, during the training process of the security situation factor extraction model, the error between the actual output and the target output of the security situation factor extraction model is back-propagated, and a stochastic gradient descent optimizer is used to adjust the hyperparameters of the model to find better weights and bias parameters to minimize the loss function and improve model performance; wherein the stochastic gradient descent optimizer randomly selects a training sample, calculates the gradient of the sample, and then uses the gradient value and learning rate to update the model parameters.
[0017] Furthermore, after the security situation factor extraction model is trained, the accuracy of the model is evaluated using test data.
[0018] A network security situation factor extraction system based on hybrid deep learning includes a memory and a processor, wherein the memory is used to store executable program code, and the processor is used to call and run the program code from the memory to implement the above-mentioned network security situation factor extraction method based on hybrid deep learning.
[0019] Compared with the prior art, the beneficial effect of the present invention is that the present invention provides a network security situation factor extraction method based on hybrid deep learning, wherein a security situation factor extraction model based on CNN-LSTM-BP is constructed, and network security situation factor extraction is performed based on the security situation factor extraction model, wherein the security situation factor extraction model includes a data input module, a convolution module, an LSTM module, a fully connected module, a BP module and an output module. First, the key situation factor features are extracted using the powerful local feature extraction capability of the convolutional neural network (CNN), and the obtained features are flattened and input into the long short-term memory network (LSTM) to solve the problem of poor time feature extraction capability of CNN; in order to achieve better classification effect, the features output by the fully connected layer are input into the back propagation (BP) network for classification, and the parameters of each module in the BP network are optimized at the same time, and the prediction residual of the BP network is corrected by using LSTM. The comparative experimental results show that the accuracy of the model reaches 97.94%, with a higher classification accuracy, and can provide more effective indicator data for security situation assessment. Therefore, the network security situation factor extraction method combines CNN, LSTM and BP neural networks, which are used for feature extraction, sequence modeling and classification tasks respectively. Among them, the convolution module is used to extract local features, the LSTM module is responsible for mining the time series features of the data, and the BP module maps the extracted features to the corresponding categories. At the same time, batch normalization, ReLU activation function and Dropout techniques are used to improve the performance and generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment:
[0021] Figure 1 This is a schematic diagram of the security situation factor extraction model structure based on CNN-LSTM-BP;
[0022] Figure 2 It is a CNN structure diagram;
[0023] Figure 3 This is the LSTM structure diagram;
[0024] Figure 4 It is a schematic diagram of BP network propagation;
[0025] Figure 5 It is the distribution diagram of sample categories in the data set;
[0026] Figure 6 It is the experimental flow chart. DETAILED DESCRIPTION
[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0029] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0031] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0032] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0033] In order to illustrate the technical solution described in this application, a specific implementation method is provided below.
[0034] This embodiment provides a method for extracting network security situation factors based on hybrid deep learning, wherein a security situation factor extraction model based on CNN-LSTM-BP is constructed, such as Figure 1 As shown in FIG. 1 , the security situation factor extraction model includes 6 modules, namely, data input module, convolution module, LSTM module, fully connected module, BP module and output module; data input module, convolution module, LSTM module, fully connected module, BP module and output module are sequentially connected. Network security situation factor extraction is performed based on the security situation factor extraction model.
[0035] The security situation factor extraction model uses data padding to process the original data into a two-dimensional matrix, and the Convolutional Neural Networks (CNN) extracts key features from it; in view of the problem that CNN cannot effectively process time series data, LSTM is used to learn time series features from the key features output by CNN; then the obtained time series data is input into the fully connected layer, and finally the output feature data is input into the BP neural network for classification, and the BP (Backpropagation algorithm, BP) algorithm is used to optimize the parameters of each module in the model, and LSTM is used to correct the prediction residual of the BP network to enhance the effect of situation factor extraction. Finally, the accuracy of the model in classifying and identifying intrusion threats is verified through experiments.
[0036] Each module is described in detail as follows.
[0037] The data input module includes a data preprocessing unit, which is used to preprocess data samples, specifically to perform preprocessing operations on the original training data. The preprocessing operations include data batching, data classification, and data format conversion to ensure that the format of the input data meets the requirements of the neural network while ensuring the quality of the data.
[0038] The convolution module is specifically a convolutional neural network (CNN). The convolutional neural network CNN is a type of feedforward neural network that includes convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning. The convolutional neural network has the ability to represent learning and can classify input information in a translation-invariant manner according to its hierarchical structure. In 1998, the famous computer scientist Yann LeCun proposed a convolutional neural network, LeNet-5, and demonstrated its first application in the task of handwritten character image recognition using the MINIST dataset. This milestone work laid an important foundation for the subsequent research and development of deep learning and is considered to be one of the pioneering works in the field of CNN. To date, convolutional neural networks have been widely used in the fields of image processing and computer vision. Compared with traditional artificial neural networks, convolutional neural networks introduce convolutional layer and pooling layer structures, and have more powerful feature extraction capabilities. As a special deep neural network, CNN is usually composed of an input layer, a convolutional layer, a pooling layer, and a fully connected layer, such as Figure 2 shown.
[0039] 1) Input layer. The input layer is mainly responsible for receiving raw data or data preprocessed by other algorithms and passing it to the convolutional layer. The role of the input layer is not only to feed data into the network, but more importantly, to perform necessary preprocessing on the input data, such as processing of outliers and missing values, so that the convolutional layer can learn and capture features more effectively.
[0040] 2) Convolution layer. The main function of the convolution layer is to extract features from the input data through the convolution kernel (also known as filter) and the receptive field. The convolution kernel consists of a weight matrix and a bias. The receptive field is the size of the area where the pixels on the feature map output by each layer are mapped on the input image. It is a sliding window with the same size as the convolution kernel on the input feature. The convolution process is based on the position of the receptive field. It extracts features by sliding the convolution kernel at a specific step size and multiplying it by the input data, and then activates the feature map through a nonlinear function. The design of the convolution layer enables the convolutional neural network to automatically learn and capture the spatial hierarchical features in the input data, providing a more meaningful representation for the subsequent network layers. The convolution operation formula is:
[0041]
[0042] in, is the value of the feature of the l-1th layer on the i-th window, p j is the local receptive field corresponding to the convolution kernel, is the weight of the convolution kernel corresponding to the position (i, j) on layer l, is the bias of the j-th window in the l-th layer, and f(·) is the activation function.
[0043] In order to reduce the number of parameters, convolutional neural networks adopt a strategy called "shared parameters", that is, during the sliding process, the convolution kernel uses the same parameters to perform convolution in the local receptive field. This parameter sharing strategy not only helps to achieve translation-invariant classification, but also makes the model lighter, enhances its scalability, and improves the training speed and generalization ability of the model.
[0044] 3) Pooling layer. After feature extraction, you can choose to add a pooling layer to reduce the representation of the mapping, or delete redundant features to prevent network overfitting. Maximum pooling and average pooling are commonly used pooling types. These two pooling methods extract the maximum value and average value of all features in the pooling area respectively. Therefore, the pooling operation can compress the original data with little change to the original data, further reduce the number of related parameters, and simplify network calculations. The pooling operation formula is as follows:
[0045]
[0046] in, represents the value of the i-th window in the l-1-th layer input feature, is the bias of the jth window in the lth layer, and pool represents the sampling function.
[0047] 4) Fully connected layer. The fully connected layer performs the final classification of the extracted features, usually at the end of the CNN network. In the forward propagation of the fully connected layer, the input feature vector is multiplied by the weight matrix using formula (3) and the bias term is added. Then, the feature vector output by formula (3) is mapped to the output value through the activation function in formula (4).
[0048] u l =W l x l-1 +b l (3)
[0049] x l =f(u l ) (4)
[0050] Among them, x l-1 represents the features corresponding to the l-1th layer, W l and b l denote the weight and bias corresponding to the lth layer, respectively, while f(·) denotes the activation function, u l represents the features after the lth fully connected layer, x l Represents the features processed by the activation function.
[0051] CNN can automatically learn the hierarchical features of input data without manual feature engineering. The convolution kernel in the convolution layer uses the same parameters when sliding over the entire input data, which greatly reduces the number of parameters and complexity of the model; at the same time, it can be expanded at will according to the form of data, which is very important for network security systems that require real-time monitoring and response.
[0052] This embodiment uses the automatic feature extraction, parameter sharing, and strong scalability of CNN in network security situation analysis to extract features from network traffic, system logs, and other data to identify abnormal behaviors or potential security threats. However, CNN is suitable for extracting local features and may not be able to effectively identify abnormal behaviors involving time series.
[0053] Therefore, the input data of the data input module passes through the convolution layer and the pooling layer in turn, and the key information of the data is extracted by moving the convolution kernel. The convolution operation adopts formula (2). To prevent overfitting, this embodiment builds a simpler convolution module. After each convolution layer, a batch normalization layer and a ReLU activation function are added. The batch normalization layer accelerates the convergence speed by standardizing the input of the data and improves the stability of the model. ReLU introduces nonlinear characteristics, so that the neural network can learn more complex function mappings. It is simple to calculate, converges quickly, and is linear in the positive interval, which helps to reduce the gradient disappearance problem.
[0054] Long Short-Term Memory neural networks (LSTM) are a unique type of recurrent neural network that has a "memory unit" that automatically captures the information computed so far in the network, thus preventing catastrophic forgetting.
[0055] Although recurrent neural networks solve the limitation of traditional neural networks that they cannot associate information from previous and subsequent sequences, they are prone to gradient vanishing or gradient exploding during back propagation due to the characteristics of parameter sharing and multiple multiplications, making the model difficult to train or unable to converge. Therefore, RNNs have difficulty capturing long-term dependencies when processing long sequences, cannot achieve long-term memory, and can only use shorter context information.
[0056] LSTM solves the gradient vanishing and gradient exploding problems of recurrent neural networks in the process of long sequence training. Its core idea is to transmit information through a cell state and determine the way the information is transmitted through a gating unit, which consists of an input gate X, a forget gate C, and an output gate H. The input gate determines which information will be updated to the cell state, the forget gate determines which information will be discarded, and the output gate determines the output of the cell state based on the current input. The weights obtained by these gates through learning are continuously continued throughout the training process, thereby improving the network's memory ability and preventing forgetting. The LSTM network structure is as follows: Figure 3 As shown in Figure 1, LSTM is actually a reuse of neural networks on the time axis. At time T = 1, it is an ordinary neural network consisting of an input layer, a hidden layer, and an output layer. As time goes by, the implicit information H of the former during training increases. t , C t is reused until the next training cycle.
[0057] This structure of LSTM enables LSTM to learn long-term dependencies more effectively, while reducing the gradient vanishing problem, so that it can better process long sequence data. Therefore, this embodiment reshapes the data processed by the CNN convolutional layer and inputs it into the LSTM network to reduce the impact of the shortcomings of the CNN model such as catastrophic forgetting and gradient vanishing.
[0058] In order to adapt to the network structure of LSTM, the View function is used to reshape the data output by the convolution module before it is input into the LSTM module. Then, the gating mechanism in the LSTM module is used to extract time series features to solve the gradient disappearance problem, allowing the model to learn long-term dependencies, thereby improving the memory capacity and time series feature extraction capabilities of the entire model.
[0059] The backpropagation (BP) algorithm is a multi-layer feedforward artificial neural network training method. It trains the neural network through optimization methods and gradient search techniques to minimize the mean square error between the actual output value and the expected output value. In theory, a three-layer BP neural network can infinitely approximate any nonlinear continuous function with infinitely small errors. The BP algorithm usually includes the forward propagation of the signal and the back propagation of the error, such as Figure 4 shown.
[0060] In forward propagation, information enters the BP network from the input layer, and passes through the nonlinear transformation of each layer in turn to obtain the final result. The result of the output layer will have an error with the actual result. At this time, it is necessary to adjust the network parameters such as the weight matrix and bias according to the error and enter the reverse propagation process of the error. The calculation formula for nonlinear transformation in the forward propagation process is as follows:
[0061] a[l] =f(w [l] a [l-1] +b [l] ) (5)
[0062] Where f(·) represents the activation function, w [l] Represents the weight matrix of the l-th layer BP network, a [l-1] represents the neuron signal of the l-1th layer, and b [l] It represents the bias matrix of layer l. The neuron signal of layer l is obtained by multiplying the signal of layer l-1 by the corresponding weight matrix and then processing it through the activation function.
[0063] The error back propagation process mainly includes error calculation and parameter update. If the mean square error is used, the error calculation is as follows:
[0064]
[0065] Among them, y k represents the expected output, and T k represents the actual output, and m represents the number of neural units.
[0066] After obtaining the error, the network will automatically adjust the weight size to make the error smaller and smaller. The weight matrix of the hidden layer and the input layer is updated using formula (7), and the bias is updated using formula (8).
[0067]
[0068] Among them, ω represents the weight, η represents the impact factor, Represents the partial derivative of the loss function L with respect to the weight ω, that is, the gradient of the weight ω.
[0069]
[0070] Where b represents bias, η represents the impact factor, Represents the partial derivative of the loss function L with respect to the bias b, that is, the gradient of the bias b.
[0071] The BP algorithm can adjust the model parameters according to the error size during the forward propagation process. Therefore, this embodiment adopts the BP algorithm to optimize the parameters of each module in the model and optimize the loss function of the entire model, so that the model can classify or regress the input data more accurately; at the same time, the LSTM module is used to effectively correct the prediction residual of the BP neural network to achieve higher-precision classification prediction.
[0072] For the fully connected module and BP module, the last time step in the LSTM module is selected as the input feature of the fully connected module and BP module, and the input features are predicted and classified. The fully connected module and BP module will output a tensor data containing logarithmic probability, and the predicted value with the largest probability is selected as the predicted category. The principle is shown in formulas (3) to (8). In addition, the Dropout function is placed after the fully connected module and BP module respectively to randomly discard some network connections during the training process, reduce the model's dependence on training data, thereby improving the model's generalization ability and preventing overfitting.
[0073] For error propagation: During the training process of the security situation factor extraction model, the error between the actual output and the target output of the security situation factor extraction model is back-propagated, and the stochastic gradient descent (SGD) optimizer is used to adjust the model's hyperparameters to find better weight and bias parameters to minimize the loss function and improve model performance. The stochastic gradient descent optimizer randomly selects a training sample, calculates the gradient of the sample, and then uses the gradient value and learning rate to update the model parameters.
[0074] Model evaluation: After the security situation factor extraction model training is completed, the accuracy of the model is evaluated using test data.
[0075] The algorithm combines CNN, LSTM and BP neural networks for feature extraction, sequence modeling and classification tasks respectively. The convolution layer is used to extract local features, the LSTM module is responsible for mining the temporal features of data, and the BP module maps the extracted features to the corresponding categories. At the same time, batch normalization, ReLU activation function and Dropout are used to improve the performance and generalization ability of the model.
[0076] Based on the above technical solution, a specific example is given as follows.
[0077] 1. Data preprocessing and parameter setting:
[0078] In 1998, MIT Lincoln Laboratory collected a DARPA intrusion detection system (IDS) evaluation dataset. The KDD Cup99 dataset comes from the tcpdump part of the dataset, which includes about 4.9 million records of various attacks and normal network data, each of which contains 42 attributes. The following is a random data in the dataset:
[0079] 2,tcp,smtp,SF,1684,363,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0.00,0.00,0.00, 0.00,1.00,0.00,0.00,104,66,0.63,0.03,0.01,0.00,0.00,0.00,0.00,0.00,normal.
[0080] Among them, the first 41 attributes are composed of 38 numeric fields and 3 non-numeric fields. Attributes 1 to 4 represent the basic characteristics of TCP connections, 23 to 31 represent time-based network traffic statistics, and 32 to 41 represent host-based network traffic statistics. The 42nd attribute of the data is a non-numeric field representing the attack type, which is divided into two categories: Normal and Attack. Attack includes four categories: Dos, Probe, U2R, and U2L, with a total of 22 attack types.
[0081] This example uses the fetch_kddcup99 function in the scikit-learn library to load the KDD Cup 99 dataset, selects 494,021 records, and divides the dataset into a training set and a test set in a ratio of 8:2. Before training, the dataset is encoded and converted to a different format.
[0082] First, the discrete feature values are encoded. Since the 2nd, 3rd, 4th, and 42nd dimension attributes of the data are non-numeric data, these 4 types of features are converted into numeric data. For example, the tcp, udp, and icmp categories in the second dimension are encoded as 1, 2, and 3 respectively. The specific attack types and encodings contained in each category in the data set are shown in Table 1, which is the attack classification encoding. The sample category distribution of the training set and the test set after encoding is shown in Figure 5 shown.
[0083] Table 1
[0084]
[0085] Secondly, in order to adapt to the network model, the data is first filled with constant values, and then the filled data is converted into a four-dimensional tensor with a shape of (-1, 1, 8, 8). The converted data is then input into the model of this embodiment for training. After the training reaches the stop requirement, the model enters the prediction stage, and finally the prediction results are classified. The specific experimental process is as follows Figure 6 shown.
[0086] This example is conducted on a computer with 8GB of memory and an Intel(R) Core(TM) i5-8250U CPU@1.60GHz processor, and the operating system is Windows 11. The experiment uses the Python programming language and uses the PyTorch platform to build the model framework. The parameter optimizer uses the SGD optimizer, the optimizer's learning rate is set to 0.005, the regularization (weight_decay) coefficient is set to 0.001, the training round is 5, and the data batch size is set to 128. The loss function uses Categorical Cross-Entropy Loss, which is calculated as follows:
[0087]
[0088] Where c represents the number of categories, p i is the true value of the i-th data, q i is the predicted value, and CE(p,q) represents the loss between p and q.
[0089] This example uses the accuracy rate (ACC) indicator to evaluate the accuracy of the model. ACC refers to the ratio of correctly classified samples to the total number of samples. The larger the ACC, the better the performance of the model to some extent. The ACC calculation formula is as follows:
[0090]
[0091] Among them, TP and TN represent the number of samples correctly classified into the attack class and non-attack class, respectively, and FN and FP refer to the number of samples misclassified into the attack class and normal class.
[0092] This example has 23 classification situations, including 1 normal category and 22 abnormal attack categories. In this example, ACC is used to evaluate the overall accuracy of this model in identifying all attack types.
[0093] 2. Classification accuracy comparison experiment:
[0094] 1) Comparison of accuracy of situation factor extraction models:
[0095] This example compares the classification accuracy of the CNN-LSTM-BP model of this embodiment with several other situation factor extraction models. Among the selected comparison models, the probabilistic neural network (PNN) is a commonly used classifier in the field of situation factor extraction. In addition, the SPIDER model in the literature in recent years, the CGAN-Transformer model (abbreviated as CGAN-TF) in the literature, and the IG-Randomforest method in the literature are selected to perform an accuracy experiment comparison with the model of this embodiment. The three use the optimized SPIDER model, Transformer model, and random forest classifier to extract situation factors respectively. The experimental comparison results are shown in Table 2. Table 2 is a comparison table of the classification accuracy of several factor extraction models.
[0096] Table 2
[0097]
[0098]
[0099] As can be seen from Table 2, the accuracy of the model in this embodiment is 17.7% higher than the classic PNN classifier, and 15.03%, 4.87% and 20.74% higher than other improved models SPIDER, CGAN-Transformer and IG-Randomforest respectively. It can be seen that the classification accuracy of the model in this embodiment is the highest and can more effectively extract network security situation elements.
[0100] 2) In order to verify the effect of LSTM-BP in optimizing the convolutional neural network model, this example adds LSTM-BP to the classic convolutional neural network models LeNet5 and MiniVGGNet, and compares the accuracy with the CNN-LSTM-BP network model proposed in this embodiment. To adapt to the data format, the model parameters are slightly adjusted, and the parameters of the LeNet5 and MiniVGGNet models are shown in Table 3. Table 3 shows the parameters of the LeNet and MiniVGGNet models. To ensure the fairness of the experiment, multiple experiments were conducted to test its accuracy, and the average value was taken. The test results are shown in Table 4. Table 4 is a comparison table of the accuracy of the typical CNN model before and after improvement.
[0101] Table 3
[0102]
[0103] Table 4
[0104] CNN Model Accuracy (%) Improved CNN model Accuracy (%) LeNet5 97.44 LeNet5-LSTM-BP 98.12 MiniVGGNet 78.85 MiniVGGNet-LSTM-BP 98.31 This embodiment of CNN 97.12 CNN-LSTM-BP 97.94
[0105] It can be seen from Table 4 that after adding LSTM and BP modules to the three convolutional neural network models of LeNet5, MiniVGGNet and CNN in this embodiment, the accuracy rates are increased by 0.68%, 19.46% and 0.82% respectively. It can be seen that after adding LSTM and BP modules to the convolutional neural network model, the classification accuracy of the model is effectively improved, especially on the MiniVGGNet model, the improvement effect is particularly significant. This shows that the use of LSTM and BP modules to optimize the convolutional neural network can improve the classification accuracy of the model, and this optimization method has generalization ability.
[0106] 3) In the study of deep learning models, ablation experiments are usually used to understand the impact of various components or factors in the neural network on the model effect, so as to determine which parts or factors have the greatest impact on the model performance. This ablation experiment is used to test the impact of LSTM and BP modules on the classification accuracy of the CNN model. The experimental parameters are exactly the same as the accuracy comparison experiment.
[0107] This ablation experiment includes 5 steps, namely, defining the neural network structure, training the neural network, determining the ablation object, performing the ablation operation, and comparative analysis. Among them, performing the ablation operation means removing or changing the part to be ablated, and then using the same training data to retrain the model after removing different modules. The ablation objects in this example include: LSTM and CNN modules, BP and CNN modules, LSTM and BP modules, BP modules, and LSTM modules. After removing different ablation objects from the model, the experiment was carried out, and the experimental results are shown in Table 5. Table 5 shows the ablation experiment results.
[0108] Table 5
[0109] Model Accuracy (%) BP 72.06 LSTM 92.70 CNN 97.12 CNN-LSTM 97.38 CNN-BP 97.24 CNN-LSTM-BP 97.94
[0110] From Table 5, we can see that the classification accuracy of the BP neural network model, LSTM model and CNN model alone is 72.06%, 92.70% and 97.12% respectively, the accuracy of the CNN model with LSTM module is 97.38%, the accuracy of the CNN model with BP module is 97.24%, and the accuracy of the CNN model with BP module and LSTM module is 97.94%. It can be seen that the CNN-LSTM-BP model with LSTM and BP modules has the highest accuracy and the best overall performance. Removing any module will reduce its accuracy. This shows that in this task, a single model cannot achieve the best performance, while the CNN model with LSTM and BP modules can make full use of the advantages of each model to achieve better classification results.
[0111] Based on the existing CNN-based network security situation factor extraction model, this embodiment proposes a network security situation factor extraction model based on hybrid deep learning. The model introduces LSTM modules and BP modules to make up for the shortcomings of CNN in processing long sequence data, enhance its classification accuracy, and improve the efficiency and accuracy of network security situation factor extraction. The results of precision comparison experiments and ablation experiments show that the method proposed in this embodiment can effectively improve the classification effect of the convolutional neural network model, classify and extract network security situation factors more accurately, and lay a good foundation for network security situation assessment. In the next step of research, we will look for more accurate and effective situation factor extraction methods, and integrate federated learning technology to extract network security situation factors while ensuring the privacy and security of industrial Internet user data.
[0112] Moreover, the network security situation factor extraction method based on hybrid deep learning proposed in this embodiment first uses the powerful local feature extraction capability of convolutional neural network (CNN) to extract key situation factor features, flattens the obtained features and inputs them into long short-term memory network (LSTM) to solve the problem of poor time feature extraction capability of CNN; in order to achieve better classification effect, the features output by the fully connected layer are input into the back propagation (BP) network for classification, and the parameters of each module in the BP network are optimized at the same time, and the prediction residual of the BP network is corrected by LSTM. The comparative experimental results show that the model has an accuracy rate of 97.94%, with a higher classification accuracy rate, and can provide more effective indicator data for security situation assessment.
[0113] This embodiment also provides a network security situation factor extraction system based on hybrid deep learning, including a memory and a processor, the memory is used to store executable program code, and the processor is used to call and run the program code from the memory to implement a network security situation factor extraction method based on hybrid deep learning. Since a network security situation factor extraction method based on hybrid deep learning has been specifically described above, it will not be repeated here.
[0114] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A network security situation factor extraction method based on hybrid deep learning, characterized in that: include: Constructing a security situation factor extraction model based on CNN-LSTM-BP, the security situation factor extraction model includes a data input module, a convolution module, an LSTM module, a fully connected module, a BP module and an output module; the data input module, the convolution module, the LSTM module, the fully connected module, the BP module and the output module are sequentially data connected; Network security situation elements are extracted based on the security situation element extraction model.
2. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: The data input module includes a data preprocessing unit, which is used to perform preprocessing operations on original training data. The preprocessing operations include data batching, data classification and data format conversion.
3. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: The convolution module includes a convolution layer and a pooling layer. The input data of the data input module passes through the convolution layer and the pooling layer in sequence to extract the key information of the data; after each convolution layer, a batch normalization layer and a ReLU activation function are added, the batch normalization layer is used to standardize the input of the data, and the ReLU introduces nonlinear characteristics to enable the neural network to learn more complex function mappings.
4. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: Before the data output by the convolution module is input into the LSTM module, the View function is used to reshape the data, and then the gating mechanism in the LSTM module is used to extract the time series features to solve the gradient disappearance problem.
5. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: For the fully connected module and BP module, the last time step in the LSTM module is selected as the input feature of the fully connected module and the BP module, and the input features are predicted and classified. The fully connected module and the BP module will output a tensor data containing logarithmic probability, and the predicted value with the largest probability is selected as the predicted category; and the Dropout function is placed after the fully connected module and the BP module respectively to randomly discard some network connections during the training process to reduce the model's dependence on training data.
6. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: During the training process of the security situation factor extraction model, the error between the actual output and the target output of the security situation factor extraction model is back-propagated, and the stochastic gradient descent optimizer is used to adjust the hyperparameters of the model to find better weights and bias parameters to minimize the loss function and improve model performance; wherein the stochastic gradient descent optimizer randomly selects a training sample, calculates the gradient of the sample, and then uses the gradient value and learning rate to update the model parameters.
7. The method for extracting network security situation elements based on hybrid deep learning according to claim 1 is characterized in that: After the security situation factor extraction model training is completed, the accuracy of the model is evaluated using test data.
8. A network security situation factor extraction system based on hybrid deep learning, characterized in that: It includes a memory and a processor, the memory is used to store executable program code, and the processor is used to call and run program code from the memory to implement the network security situation element extraction method based on hybrid deep learning as described in any one of claims 1-7.
Citation Information
Cited By
Distributed Transform training-oriented gradient bounded loss tolerance transmission optimization method
CN119996533A
Gradient Bounded Loss Tolerant Transmission Optimization Method for Distributed Transformer Training
CN119996533B
Network security situation assessment method based on data mining
CN120074967A
Network security management method and system based on artificial intelligence
CN120498808A
Private cloud collaborative management platform
CN120935175A
