Industrial control network anomaly detection method and system
Through the combination of conditional generative adversarial network and XGBoost algorithm, the problems of low recognition rate and weak generalization in industrial control network anomaly detection are solved, the detection efficiency and accuracy are improved, the security of industrial control systems is enhanced, and the Risk of robot failure.
Patent Information
- Application Number
- CN202111591012.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-12-23
AI Technical Summary
Existing industrial control network anomaly detection methods have low recognition rates and weak generalization for industrial control networks. The traditional XGBoost algorithm is inefficient when processing large amounts of data and is prone to overfitting. It also interrupts the maintenance of the TF tree of the industrial control system ROS. The robot cannot work properly and poses a safety hazard.
The conditional generative adversarial network CGAN is used to learn the probability distribution of abnormal data samples, XGBoost is used to generate new feature combinations, and a gradient-based sample selection strategy is introduced to enhance data set and feature selection, and improve model generalization and recognition rate.
It improves the recognition rate and generalization of industrial control network anomaly detection, solves the problem of scarcity and imbalance of sample data, enhances the security of industrial control networks, and reduces the risk of robot failure caused by network anomalies.
Smart Images

Figure CN114283306B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information security, and in particular relates to an industrial control network anomaly detection method and system. Background Art
[0002] The robot operating system ROS was born in a laboratory environment, and research on security has not been taken seriously, resulting in many security issues in ROS. With the popularity of open source and ROS, security issues have become increasingly prominent.
[0003] The robot system ROS relies on mutual conversion between different coordinate systems to complete specific actions. This process depends on the TF package. The TF package is a callable library that continuously collects and updates the position information between different nodes, that is, the conversion information between different coordinate systems.
[0004] The establishment and maintenance of TF tree is based on the topic communication mechanism, which must be published and subscribed by nodes at the same time. Maintaining TF tree is a process of collecting and updating different coordinate systems. Once interrupted, the entire ROS will fail. At present, due to many security issues in ROS, it is easy to be disturbed by abnormal network traffic, resulting in interruption of TF tree maintenance process, so that the robot cannot complete specific actions normally, and even worse, some serious accidents will occur.
[0005] Because of this, it is particularly important to maintain the normal operation of TF tree. Although ROS supports message encryption to improve security, this security strength is far from enough. Traditional measures to prevent industrial control networks from being attacked by network attacks are mainly to parse and identify abnormal communication behaviors of general Internet protocols, and match them according to preset rules and feature values to achieve simple security filtering. The above abnormal behavior detection method has some defects that cannot be ignored: it mainly relies on feature matching to identify dangerous network behaviors, which not only has a low recognition rate for industrial control network anomalies, but also has weak generalization. Generalization is the learning ability of the evaluation model. The higher the generalization, the stronger the learning ability and the more accurate the classification. Taking the BP neural network for traffic detection as an example, the recognition rate of various abnormal traffic is about 80%, and the algorithm needs to be improved to improve the generalization.
[0006] The model obtained by the traditional XGBoost algorithm needs to process a large amount of data. In each round of iteration, the entire training data needs to be traversed multiple times. If the entire training data is loaded into the memory, the size of the training data will be limited; if it is not loaded into the memory, repeatedly reading and writing the training data will consume a lot of time. Although accurate partitioning conditions can be found, the amount of calculation is huge, the memory usage is huge, it is easy to produce overfitting, low efficiency, and may generate unnecessary leaf nodes. Summary of the invention
[0007] The purpose of the present invention is to provide an industrial control network anomaly detection method and system, which are conducive to improving the recognition rate and generalization of industrial control network anomaly detection.
[0008] To achieve the above object, the technical solution adopted by the present invention is: a method for detecting anomalies in an industrial control network, comprising the following steps:
[0009] Step S1, using the conditional generative adversarial network (CGAN) to learn the probability distribution of a small number of abnormal data samples, and then using the generator model to generate supplementary samples of abnormal data, thereby achieving abnormal data set augmentation;
[0010] Step S2: The augmented data set generates new feature combinations through XGBoost, and then the optimal feature subset is obtained through Friedman's test feature selection algorithm;
[0011] Step S3: During the model training process, a gradient-based sample selection strategy is introduced to retain samples with larger gradients and randomly discard data samples with smaller gradients. The final model is obtained by generating a new sampling weight data set for training.
[0012] Step S4: Perform industrial control network anomaly detection using the final model obtained.
[0013] Furthermore, the step S1 specifically includes the following steps:
[0014] Step S101: In the industrial control system ROS, use the topic: / tf that maintains the TF tree; intercept the network traffic whose protocol_type is TCP, and save the network traffic locally in advance;
[0015] Step S102, parse the TCP data packet, obtain the TCPROS data packet by matching the destination address, source address and port, and parse the TCPROS data packet to obtain the IP data;
[0016] Step S103: selecting abnormal data from the IP data, preprocessing the abnormal data, and then segmenting the abnormal data into a training set and a test set;
[0017] Step S104: Take the data with topic / tf as a condition to train the GAN network to obtain augmented data; use the conditional generative adversarial network CGAN to learn the probability distribution of a small number of abnormal data samples, and then use the generator model to generate supplementary samples of abnormal data, thereby realizing the augmentation of the abnormal data set.
[0018] Furthermore, in step S103, the preprocessing includes de-meaning, normalization and dimensionality reduction.
[0019] Furthermore, in step S103, the specific method of removing the mean is: obtaining network data, and constructing a data set X according to the network data, X∈R n , where R represents a real number set and n represents the total number of samples in the data set;
[0020] The specific method of normalization is: use the Z-score normalization method to normalize the obtained data set. In the n data set, the normalized n data sets are divided into new data sets X according to the ratio of n-1:1. new and validation set X Validation , and then the new data set X new Divide into training set X according to the ratio of 5:1 train ∈R n×m and the test set X test ∈R n×m ;
[0021] The specific method of dimensionality reduction is: use the PCA method to obtain the training set X train Feature extraction is performed to obtain a new feature vector set after dimensionality reduction; a feature of each sample in the normalized network data is used as a data dimension to convert the sample into a feature vector, and the feature vectors corresponding to all samples constitute a sample set.
[0022] Furthermore, the optimization function of the conditional generative adversarial network CGAN is defined as follows:
[0023]
[0024] In the formula, G is the generating network, D is the judging network, x is the sample data, z is the random input noise, and y is the auxiliary condition;
[0025] The generative network and the decision network of CGAN are trained separately and iteratively, using binary minimization.
[0026] First, put the abnormal IP data samples into the decision network for training, learn the probability of a small number of abnormal data samples, and obtain the parameters of the decision network;
[0027] The purpose of the generator network is to input random noise and output noise samples. The noise samples pass through the decision network to expand the original samples with noise samples. The noise samples are sent to the generator network for training to generate new samples, and the generated samples are placed in the decision network to obtain the prediction results. At the beginning, the decision network determines that the noise samples are not abnormal data. The parameters of the generator network are modified to make the prediction results of the noise samples judged by the decision network as large as possible. Then they are placed in the generator network to generate new samples until the decision network considers that the samples are abnormal data.
[0028] Furthermore, the step S2 specifically includes the following steps:
[0029] Step S201: Use the XGBoost algorithm to perform feature screening and generate a new feature combination based on whether the data is abnormal or not;
[0030] Step S202: The new feature combination is scored and ranked using the Friedman's test feature selection algorithm, and the one with the highest ranking is the optimal feature subset.
[0031] Furthermore, the step S3 specifically includes the following steps:
[0032] Step S301: Input the extended sample data set into the decision tree constructed based on the XGBoost algorithm to obtain the predicted value; after obtaining the feature set in the IP data packet header, construct the objective function:
[0033] obj(θ)=TL(θ)+R(θ)
[0034] Among them, θ is a set of vectors consisting of sample features; TL represents the loss function and R represents the regularization term; the former is used to measure the predictive ability of the model, and the latter is used to keep the complexity of the model within the required limit and eliminate less accurate models;
[0035] After building the first XGBoost tree, the sample set samples of the feature set are input into the first decision tree to obtain the predicted value of the sample; the sample set is scored according to the feature set, and the features are used as scoring nodes. The samples are classified through the binary tree composed of nodes to obtain the corresponding predicted value;
[0036] Step S302: construct a second tree based on the residuals obtained from the predicted values and the true values, and so on. When the number of iterations reaches the upper limit or the residuals no longer decrease or even stop, a strong classifier with multiple decision trees is obtained. The test set data set is input into this model to test the detection ability of the model.
[0037] Step S303, introduce a gradient selection strategy into the training model, randomly discard small gradient samples, retain large gradient samples, generate new data weights, and achieve the purpose of fast sample processing; exclude most of the small gradient samples, and only use the remaining samples to calculate the information gain; when downsampling, try to retain samples with large gradients and randomly remove samples with small gradients.
[0038] The present invention also provides an industrial control network anomaly detection system, comprising a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.
[0039] Compared with the prior art, the present invention has the following beneficial effects: it provides an industrial control network anomaly detection method and system based on improved XGBoost, which can solve the problems of scarce sample data and unbalanced abnormal samples in the existing industrial network traffic anomaly detection, improve the recognition rate of industrial control network anomaly detection, have strong generalization, and have strong practicality and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of the method implementation of the embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0042] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0043] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0044] like Figure 1 As shown, this embodiment provides an industrial control network anomaly detection method, comprising the following steps:
[0045] Step S1: Use the conditional generative adversarial network (CGAN) to learn the probability distribution of a small number of abnormal data samples, and then use the generator model to generate supplementary samples of abnormal data, thereby achieving abnormal data set augmentation.
[0046] The step S1 specifically includes the following steps:
[0047] Step S101: In the industrial control system ROS, use the topic: / tf that maintains the TF tree to intercept the network traffic whose protocol_type is TCP, and save the network traffic locally in advance.
[0048] In the industrial control system ROS, different nodes obtain different data through topic publishing. Topics are the bus between ROS nodes for data exchange and one-way communication, acting as an intermediate hub. When the robot hand-eye calibration is working properly, it depends on a large number of different coordinate system conversions, and ROS obtains coordinate system conversion information by maintaining the topic of TF tree: / tf.
[0049] Step S102: parse the TCP data packet, obtain the TCPROS data packet by matching the destination address, source address and port, and parse the TCPROS data packet to obtain the IP data.
[0050] The original abnormal data of ROS is obtained through steps S101-102, and abnormal samples are provided for the following to obtain an augmented abnormal data sample set. After obtaining the IP data, the data can be pre-processed and then augmented.
[0051] Step S103: select abnormal data from the IP data, pre-process the abnormal data, and then segment the abnormal data into a training set and a test set.
[0052] Preprocessing includes de-meaning, normalization, and dimensionality reduction.
[0053] The specific method of removing the mean is: obtain network data and construct a data set X based on the network data, X∈R n , where R represents the set of real numbers and n represents the total number of samples in the data set.
[0054] The specific method of normalization is: use the Z-score normalization method to normalize the obtained data set. In the n data set, the normalized n data sets are divided into new data sets X according to the ratio of n-1:1. new and validation set X Validation , and then the new data set X new Divide into training set X according to the ratio of 5:1 train ∈R n×m and the test set X test ∈R n×m .
[0055] The specific method of dimensionality reduction is: use the PCA method to obtain the training set X train Perform feature extraction to obtain a new feature vector set after dimensionality reduction. Take a feature of each sample in the normalized network data as a data dimension, so as to convert the sample into a feature vector, and the feature vectors corresponding to all samples constitute a sample set.
[0056] Step S104: Take the data with topic / tf as the condition, train the GAN network, and obtain augmented data. The conditional generative adversarial network CGAN is used to learn the probability distribution of a set number of abnormal data samples, and then the generator model generates supplementary samples of abnormal data, thereby realizing the augmentation of abnormal data sets.
[0057] In order to solve the problem of abnormal topic attacks that may occur during hand-eye calibration and cause the robot arm to work abnormally, the safety of the topic must be guaranteed. For this situation, this topic is used as a condition for judgment.
[0058] The optimization function of the conditional generative adversarial network CGAN is defined as follows:
[0059]
[0060] In the formula, G is the generating network, D is the judging network, x is the sample data, z is the random input noise, and y is the auxiliary condition.
[0061] The generative network and decision network of CGAN are trained separately and alternately, using binary minimization.
[0062] First, put the abnormal IP data samples into the decision network for training, learn the probability of a small number of abnormal data samples, and obtain the parameters of the decision network. Optimize the first term of the formula D so that when the true sample x is input, the result is close to 1, which is related to the second term, that is, the smaller the D(G(z)), the better, because its label is 0, so for uniformity it is written as 1-D(G(z|y)).
[0063] The purpose of the generator network is to input random noise and output noise samples. The noise samples pass through the decision network to expand the original samples with noise samples. The noise samples are sent to the generator network for training to generate new samples, and the generated samples are placed in the decision network to obtain the prediction results. At the beginning, the decision network determines that the noise samples are not abnormal data. The parameters of the generator network are modified to make the prediction results of the noise samples determined by the decision network as large as possible. Then put them into the generator network to generate new samples until the decision network considers the samples to be abnormal data.
[0064] Step S2: The augmented data set generates new feature combinations through XGBoost, and then the optimal feature subset is obtained through the Friedman's test feature selection algorithm.
[0065] The step S2 specifically includes the following steps:
[0066] Step S201: Use the XGBoost algorithm to perform feature screening and generate new feature combinations based on conditions such as whether the data is abnormal.
[0067] Step S202: The new feature combination is scored and ranked using the Friedman's test feature selection algorithm, and the one with the highest ranking is the optimal feature subset.
[0068] Step S3: During the model training process, a gradient-based sample selection strategy is introduced to retain samples with larger gradients and randomly discard data samples with smaller gradients. The final model is obtained by generating a new sampling weight data set for training.
[0069] The step S3 specifically comprises the following steps:
[0070] Step S301: Input the extended sample data set into the decision tree constructed based on the XGBoost algorithm to obtain the predicted value. After obtaining the feature set in the IP data packet header, construct the objective function:
[0071] obj(θ)=TL(θ)+R(θ)
[0072] Among them, θ is a set of vectors consisting of sample features. TL represents the loss function and R represents the regularization term. The former is used to measure the predictive ability of the model, and the latter is used to keep the complexity of the model within the required limit and eliminate less accurate models.
[0073] After building the first XGBoost tree, input the sample set samples of the feature set into the first decision tree to get the predicted value of the sample. Score the samples according to the feature set of the samples in the sample set, such as dst_bytes, src_bytes, wrong_fragment, urgent, land, service, flag, num_failed_logins. These features can be used as scoring nodes, and the samples are classified through the binary tree composed of nodes to obtain the corresponding predicted value.
[0074] Step S302: construct a second tree based on the residual obtained from the predicted value and the true value, and so on. When the number of iterations reaches the upper limit or the residual no longer decreases or even stops, a strong classifier with multiple decision trees is obtained. The test set data set is input into this model to test the detection ability of the model.
[0075] Step S303, introduce the gradient selection strategy in the training model, randomly discard small gradient samples, retain large gradient samples, generate new data weights, and achieve the purpose of fast processing samples. Most of the samples with small gradients are excluded, and only the remaining samples are used to calculate the information gain. According to the definition of calculating information gain, instances with large gradients have a greater impact on information gain. Therefore, when downsampling, samples with large gradients are retained as much as possible (pre-set thresholds, or between the highest percentiles), and samples with small gradients (less than the set threshold) are randomly removed. This measure obtains more accurate results than random sampling at the same sampling rate, especially when the information gain range is large. The decision tree is an optimization process that uses the addition model and the forward distribution algorithm to achieve learning. XGBoost uses second-order derivatives, and calculating information gain requires scanning all samples to find the optimal partitioning point. When faced with a large amount of data or a high feature dimension, its efficiency and scalability are difficult to satisfy. The direct way to solve this problem is to reduce the amount of features and data without affecting the accuracy. Some work speeds up the boosting process based on data weight sampling.
[0076] Step S4: Perform industrial control network anomaly detection using the final model obtained.
[0077] This embodiment also provides an industrial control network anomaly detection system, including a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.
[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0079] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0082] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A method for detecting anomalies in an industrial control network, characterized in that: The following steps are involved: Step S1, using the conditional generative adversarial network (CGAN) to learn the probability distribution of a small number of abnormal data samples, and then using the generator model to generate supplementary samples of abnormal data, thereby achieving abnormal data set augmentation; Step S2, the augmented data set generates a new feature combination through XGBoost, and then the Friedman's test feature selection algorithm is used to obtain the optimal feature subset; Step S3: During the model training process, a gradient-based sample selection strategy is introduced to retain samples with larger gradients and randomly discard data samples with smaller gradients. The final model is obtained by generating a new sampling weight data set for training. Step S4: Performing industrial control network anomaly detection using the final model obtained; The step S1 specifically includes the following steps: Step S101, in the industrial control system ROS, use the topic: / tf that maintains TFtree; intercept the network traffic whose protocol_type is TCP, and save the network traffic locally in advance; Step S102, parse the TCP data packet, obtain the TCPROS data packet by matching the destination address, source address and port, and parse the TCPROS data packet to obtain the IP data; Step S103: selecting abnormal data from the IP data, preprocessing the abnormal data, and then segmenting the abnormal data into a training set and a test set; Step S104: using the data with topic / tf as a condition, training the GAN network to obtain augmented data; using the conditional generative adversarial network CGAN to learn the probability distribution of a small number of abnormal data samples, and then using the generator model to generate supplementary samples of abnormal data, thereby achieving augmentation of the abnormal data set; The optimization function of the conditional generative adversarial network CGAN is defined as follows: In the formula, G is the generating network, D is the judging network, x is the sample data, z is the random input noise, and y is the auxiliary condition; The generative network and the decision network of CGAN are trained separately and iteratively, using binary minimization. First, put the abnormal IP data samples into the decision network for training, learn the probability of a small number of abnormal data samples, and obtain the parameters of the decision network; The purpose of the generator network is to input random noise and output noise samples. The noise samples pass through the decision network to expand the original samples with noise samples. The noise samples are sent to the generator network for training to generate new samples. The generated samples are placed in the decision network to obtain prediction results. At the beginning, the decision network determines that the noise samples are not abnormal data. The parameters of the generator network are modified to increase the prediction results of the noise samples as much as possible. Then, new samples are placed in the generator network until the decision network determines that the samples are abnormal data. The step S2 specifically includes the following steps: Step S201: Use the XGBoost algorithm to perform feature screening and generate a new feature combination based on whether the data is abnormal or not; Step S202: The new feature combination is scored and ranked by the Friedman's test feature selection algorithm, and the highest ranking is the optimal feature subset; The step S3 specifically comprises the following steps: Step S301: Input the extended sample data set into the decision tree constructed based on the XGBoost algorithm to obtain the predicted value; after obtaining the feature set in the IP data packet header, construct the objective function: obj(θ)=TL(θ)+R(θ) Among them, θ is a set of vectors consisting of sample features; TL represents the loss function and R represents the regularization term; the former is used to measure the predictive ability of the model, and the latter is used to keep the complexity of the model within the required limit and eliminate less accurate models; After building the first XGBoost tree, the sample set samples of the feature set are input into the first decision tree to obtain the predicted value of the sample; the sample set is scored according to the feature set, and the features are used as scoring nodes. The samples are classified through the binary tree composed of nodes to obtain the corresponding predicted value; Step S302: construct a second tree based on the residuals obtained from the predicted values and the true values, and so on. When the number of iterations reaches the upper limit or the residuals no longer decrease or even stop, a strong classifier with multiple decision trees is obtained. The test set data set is input into this model to test the detection ability of the model. Step S303, introduce a gradient selection strategy into the training model, randomly discard small gradient samples, retain large gradient samples, generate new data weights, and achieve the purpose of fast sample processing; exclude most of the small gradient samples, and only use the remaining samples to calculate the information gain; when downsampling, try to retain samples with large gradients and randomly remove samples with small gradients.
2. The method for detecting anomalies in an industrial control network according to claim 1, characterized in that: In the step S103, the preprocessing includes removing the mean, normalization and dimensionality reduction.
3. The method for detecting anomalies in an industrial control network according to claim 1, characterized in that: In step S103, the specific method of removing the mean is: obtaining network data, and constructing a data set X according to the network data, X∈R n , where R represents a real number set and n represents the total number of samples in the data set; The specific method of normalization is: use the Z-score normalization method to normalize the obtained data set. In the n data set, the normalized n data sets are divided into new data sets X according to the ratio of n-1:
1. new and validation set X Validation , and then the new data set X new Divide into training set X according to the ratio of 5:1 train ∈R n×m and the test set X test ∈R n×m ; The specific method of dimensionality reduction is: use the PCA method to obtain the training set X train Feature extraction is performed to obtain a new feature vector set after dimensionality reduction; a feature of each sample in the normalized network data is used as a data dimension to convert the sample into a feature vector, and the feature vectors corresponding to all samples constitute a sample set.
4. An industrial control network anomaly detection system, characterized in that: The method comprises a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, the method steps as described in any one of claims 1 to 3 can be implemented.
