Network attack processing method and system based on zero-sum game
By introducing an integrated learning method based on zero-sum game and a generative adversarial network GAN model in network attack detection, the problems of data imbalance and limitations of multi-classification tasks are solved, and the accuracy and efficiency of network attack detection are improved.
Patent Information
- Application Number
- CN202510245633.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The existing technology has data imbalance problem in network intrusion detection, which leads to the lack of effective conditional constraints in the training process of generative adversarial network algorithms, and the generation results are still imbalanced. The existing classification algorithms have limitations in multi-classification tasks, making it difficult to effectively detect a few components when data distribution is uneven.
The zero-sum game-based network attack processing method is adopted, and the combination strategy of multiple classifiers is optimized through the integrated learning method, the target sample in the sample is determined, and the generative adversarial network GAN model is used for quantitative expansion processing to generate expanded samples with authenticity and diversity.
Improves the robustness and performance of classifiers when processing imbalanced data, ensures the authenticity and diversity of generated samples, and enhances the accuracy of handling network attacks.
Smart Images

Figure CN119788413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data processing, and in particular to a network attack processing method and system based on zero-sum game. Background Art
[0002] With the rapid development of technology, especially the widespread application of technologies such as cloud computing, big data, the Internet of Things and artificial intelligence, the means and tools of cyber attacks are also constantly improving, leading to an increasing number of cyber security threats.
[0003] In the prior art, researchers have proposed using a method based on generative adversarial networks (GANs) to enhance the performance of network intrusion detection systems (NIDS). For example, in Lee GC, Li JH, Li Z Y. A Wasserstein Generative Adversarial Network–Gradient Penalty-Based Model with Imbalanced Data Enhancement for Network Intrusion Detection[J]. Applied Sciences, 2023, 13(14): 8132., Gwo-Chuan Lee et al. proposed a model based on Wasserstein generative adversarial networks-gradient penalties to solve the data imbalance problem in network intrusion detection systems through data enhancement and improve the recognition accuracy of rare attack types. The introduction of the gradient penalty method makes model training more stable and easy to converge. However, the resulting two-stage fine-tuning algorithm increases the complexity and computational cost of the system and is highly dependent on data quality.
[0004] In Li Z, Chen S, Dai H, et al. Abnormal traffic detection: Trafficfeature extraction and DAE-GAN with efficient data augmentation[J]. IEEETransactions on Reliability, 2022, 72(2): 498-510., Zecheng Li et al. proposed a denoising autoencoder model based on generative adversarial network, using abnormal traffic detection method, through efficient data enhancement and feature extraction framework, using generated pseudo-abnormal data to improve the semi-supervised anomaly detection model, and improving the accuracy and efficiency of network intrusion detection. Because it contains multiple denoising autoencoders and adversarial training processes, it has high requirements on computing resources and implementation; the computational cost of processing high-dimensional data is high.
[0005] In the process of implementing the above-mentioned prior art, it was found that the existing data enhancement algorithms mainly rely on generative adversarial networks. However, these algorithms lack effective conditional constraints during the training process, resulting in imbalanced generation results, which in turn exacerbates the imbalance problem of data expansion. In addition, the existing classification algorithms are all single algorithms, which are accompanied by limitations in multi-classification tasks. When the data distribution is uneven, the overall classification index is good, but its minority components cannot be effectively detected, and the index is poor, resulting in low accuracy in handling network attacks. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a network attack processing method and system based on zero-sum game.
[0007] The present invention is achieved through the following technical solutions: The present invention provides a network attack processing method based on zero-sum game, comprising: Determine a target sample in the sample according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample, wherein each classifier includes at least a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, the sample includes network attack information, and the optimal weight of each classifier includes a value obtained after each classifier iteratively processes the sample to a Nash equilibrium; The target class samples are expanded in number by using a generative adversarial network (GAN) model to obtain expanded samples; Network attack detection is performed based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
[0008] Furthermore, determining the target sample in the sample according to the optimal weight of each classifier in the classification system and the prediction value of each classifier for the sample includes: The samples are classified by random forest classifier Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; The samples are classified by gradient boosting classifier Process and obtain the predicted value ; according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier.
[0009] Furthermore, the step of determining the target sample in the sample according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample further includes: No. The weight of the classifier in the t+1th iteration , and The weight of the classifier in the tth iteration After the absolute value of the subtraction reaches Nash equilibrium, the weight is determined For the The optimal weights of the classifier ,in, , Indicates The classifier in The profit in the iterations, the profit in each iteration , error rate , Indicates The feature vector of the samples, Indicates The true labels of samples, is the indicator function, when Classifier for samples The predicted value and the true label At the same time, The value is 1, otherwise it is 0. The first classifier is the random forest classifier, the second classifier is the extreme random trees classifier, and the third classifier is the gradient boosting classifier.
[0010] Furthermore, the generative adversarial network (GAN) model includes: a decoder, an encoder, a generator and a judger; The decoder is connected to the encoder, the encoder is responsible for dimensionality reduction processing of target samples, and the decoder is responsible for remapping the target samples reduced in dimension by the encoder back to the high-dimensional data space; The generator is connected to the decoder and is used to generate an extended sample from the target sample sent by the decoder; The judger is connected to the generator and is used to judge whether the expanded samples generated by the generator meet the conditions; The generative adversarial network GAN model includes an adversarial loss sub-model, a reconstruction loss sub-model, a difference loss sub-model and a momentary loss sub-model; wherein the adversarial loss sub-model Used to improve the authenticity of samples generated by the generator, where represents the target sample, represents a random noise vector, Indicates conditions, represents a generator, represents the discriminator, Indicates that the data distribution Next pair and The expected value of the data distribution Represents the distribution law of the samples of the original data set, data represents the original data set; The reconstruction loss submodel Used to increase the distribution gap between samples in the encoder during dimensionality reduction. Indicates the result after the target sample and condition are input to the encoder and then to the decoder, double absolute value is the norm; Differential loss sub-model Used to ensure the diversity of generated samples, where Representation sample and The Euclidean distance between For each sample With other samples The minimum distance between A temporal loss sub-model to ensure that the generated samples are similar to the samples in low-dimensional space , E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the target sample after the encoder.
[0011] Furthermore, the generative adversarial network GAN model also includes: a function for measuring the similarity between the generated sample and the sample in feature distribution ,in, represents the target sample, represents the expanded sample, is the sample size.
[0012] The present invention also provides a network attack processing system, comprising: A classification module, used for determining a target sample in the sample according to an optimal weight of each classifier in the classification system and a predicted value of each classifier for the sample, the number of the samples not classified as the target samples is greater than the number of the target samples, the classifiers at least include a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, the sample includes network attack information, and the optimal weight of each classifier includes a value obtained after each classifier iteratively processes the sample to a Nash equilibrium; An expansion module is used to expand the number of target class samples through a generative adversarial network (GAN) model to obtain expanded samples; The determination module is used to perform network attack detection based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
[0013] Furthermore, the classification module is also used to classify the samples through a random forest classifier. Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; Gradient boosting classifier for samples Process and obtain the predicted value ;according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier.
[0014] Furthermore, the classification module is also used for The weight of the classifier in the t+1th iteration , and The weight of the classifier in the tth iteration After the absolute value of the subtraction reaches Nash equilibrium, the weight is determined For the The optimal weights of the classifier ,in, , Indicates The classifier in The profit in the iterations, the profit in each iteration , error rate , Indicates The feature vector of the samples, Indicates The true labels of samples, is the indicator function, when Classifier for samples The predicted value and the true label At the same time, The value is 1, otherwise it is 0. The first classifier is the random forest classifier, the second classifier is the extreme random trees classifier, and the third classifier is the gradient boosting classifier.
[0015] Furthermore, the generative adversarial network (GAN) model includes: a decoder, an encoder, a generator and a judger; The decoder is connected to the encoder, the encoder is responsible for dimensionality reduction processing of target samples, and the decoder is responsible for remapping the target samples reduced in dimension by the encoder back to the high-dimensional data space; The generator is connected to the decoder and is used to generate an extended sample through the decoder using the target sample sent by the generator; The judger is connected to the generator and is used to judge whether the expanded samples generated by the generator meet the conditions; The generative adversarial network GAN model includes an adversarial loss sub-model, a reconstruction loss sub-model, a difference loss sub-model and a momentary loss sub-model; wherein the adversarial loss sub-model Used to improve the authenticity of samples generated by the generator, where represents the target sample, represents a random noise vector, Indicates conditions, represents a generator, represents the discriminator, Indicates that the data distribution Next pair and The expected value of the data distribution represents the distribution law of the samples of the original data set, data represents the original data set; the reconstruction loss sub-model Used to increase the distribution gap between samples in the encoder during dimensionality reduction. Indicates the result after the target sample and condition are input to the encoder and then to the decoder, double absolute value is the norm; Differential loss sub-model Used to ensure the diversity of generated samples, where Representation sample and The Euclidean distance between For each sample With other samples The minimum distance between A temporal loss sub-model to ensure that the generated samples are similar to the samples in low-dimensional space , E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the target sample after the encoder.
[0016] Furthermore, the generative adversarial network GAN model also includes: a function for measuring the similarity between the generated sample and the sample in feature distribution ,in, represents the target sample, represents the expanded sample, is the sample size.
[0017] Compared with the prior art, the present invention has the following beneficial technical effects: The Nash equilibrium idea in game theory is introduced. Through the integrated learning method, the combination strategy of multiple classifiers is optimized to improve the robustness and performance of the classifier when processing unbalanced data. Furthermore, the introduction of multiple loss function models can constrain the training effect of the model in many aspects, accelerate the convergence speed of the model, and ensure the authenticity and diversity of the generated samples. At the same time, the Transformer architecture is used for the model, so that the model has consistent feature extraction and representation capabilities when processing complex data, that is, target samples. Through the multi-head attention mechanism, the model can pay attention to different parts of the target sample at the same time and find hidden attack features in a wider feature space. Thereby improving the accuracy of handling network attacks.
[0018] The present invention provides a network attack processing method and system based on zero-sum game. According to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample, the target sample in the sample is determined, the number of the samples not classified as the target sample is greater than the number of the target samples, the classifiers at least include a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, the sample includes network attack information, and the optimal weight of each classifier includes the value obtained after each classifier iteratively processes the sample to Nash equilibrium; then, the target class samples are expanded in number through a generative adversarial network GAN model to obtain an expanded sample; then, network attack detection is performed based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior. Generate an expanded sample with authenticity and diversity through the generative adversarial network GAN model, which is conducive to finding hidden network intrusion attack behaviors. Thereby improving the accuracy of processing network attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a method for processing a network attack based on zero-sum game according to an embodiment of the present invention; Figure 2 It is a schematic diagram of the structure of an integrated learning classifier under a game theory strategy in one embodiment of the present invention; Figure 3 Schematic diagram of the overall structure of a generative adversarial network (GAN) model in one embodiment of the present invention; Figure 4 It is a schematic diagram of the specific structure of a generative adversarial network (GAN) model in one embodiment of the present invention; Figure 5 It is a multi-loss curve diagram of a generative adversarial network (GAN) model in one embodiment of the present invention.
[0020] Figure 6It is a structural diagram of a network attack processing system based on zero-sum game according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The present invention is further described in detail below in conjunction with specific embodiments, which are intended to explain the present invention rather than to limit it.
[0022] A network attack processing system based on zero-sum game provided by an embodiment of the present invention is suitable for situations where in actual network traffic, legitimate communication data far outweighs malicious attack data. This imbalance leads to deviations in the training of attack detection models, causing existing models to tend to ignore those rare but critical malicious attack scenarios. Furthermore, the network attack processing system based on zero-sum game provided by an embodiment of the present invention can be set inside a network attack detector or outside a network attack detector. When set outside a network attack detector, it can be an independently set system or a system set together with a network attack detector, and there is no limitation here. An embodiment of the present invention solves the problem of data imbalance in a network intrusion detection system by generating expanded samples through a generative adversarial network (GAN) model, thereby improving the accuracy of identifying rare attack types.
[0023] The zero-sum game-based network attack processing method provided in the embodiment of the present invention is mainly implemented by a classifier and a generative adversarial network GAN, wherein the classifier is based on a zero-sum game, and the generative adversarial network GAN is also based on a zero-sum game, which is specifically described as follows: Figure 1 FIG. 1 is a flow chart of a method for processing a network attack based on zero-sum game according to an embodiment of the present invention; Figure 1 As shown, the network attack processing method based on zero-sum game includes the following steps: Step 101: Determine a target sample among the samples according to the optimal weight of each classifier in the classification system and the prediction value of each classifier for the sample.
[0024] In this embodiment, the number of samples that are not classified as target samples is greater than the number of target samples, the classifiers include at least a random forest classifier, an extreme random tree classifier, and a gradient boosting classifier, the samples include network attack information, and the optimal weights of the classifiers include values obtained after the classifiers iteratively process the samples until Nash equilibrium is reached; Specifically, this embodiment introduces the Nash equilibrium concept in game theory and optimizes the combination strategy of multiple classifiers through ensemble learning methods to improve the robustness and performance of the classifier when processing unbalanced data. Figure 2 shown.
[0025] At the beginning of training, three classifiers are initialized, namely RandomForestClassifier, ExtraTreesClassifier and GradientBoostingClassifier. The initial weight of each classifier is ,satisfy For each classifier, calculate its error rate. Assume that the error rates are , ,The error rate formula is shown in (1): (1) in, Indicates The feature vector of the samples, Indicates The true labels of the samples. is the indicator function, when the classifier For samples The predicted value and the true label At the same time, The value is 1 if yes, otherwise 0.
[0026] The profit of each classifier is calculated based on the error rate. The lower the error rate, the higher the profit. The profit formula in each iteration is shown in (2): (2) Define the weights of the three classifiers . And adjust the weight according to the income. The update formula is shown in (3): (3) Indicates The classifier in The weight in the iteration, Indicates The classifier in The profit in iterations.
[0027] Repeat the steps of calculating error rate, gain, and updating policy until the change in weight is less than a small threshold , that is, to reach Nash equilibrium, as shown in formula (4): (4) After reaching the Nash equilibrium, the final prediction result is the weighted average of the prediction results of each classifier, as shown in formula (5): (5) Represents the final prediction probability based on the weighted average of the prediction results of each classifier. Among them, through continuous iteration, when the benefits of each classifier reach the Nash equilibrium state, the optimal weight of each classifier is determined according to the benefit value and the total benefit. For example, the random forest classifier Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; The samples are classified by gradient boosting classifier Process and obtain the predicted value ; according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier. The first classifier is a random forest classifier, the second classifier is an extreme random tree classifier, and the third classifier is a gradient boosting classifier.
[0028] In order to better reflect the performance advantages of our proposed classifier, we compared the performance of the classifier on the KDDTrain+ and KDDTest+ datasets. The results are shown in the table. Our optimization strategy performs better than the traditional single classifier in the classification task, especially in the identification of scarce samples, showing a significant performance improvement. This further proves the effectiveness and practicality of optimizing the combination of classifiers through game theory strategies.
[0029] Table 1: Comparison of classifier accuracy performance
[0030] Furthermore, we list the various indicators in the multi-classification task of ensemble learning as shown in the table. The overall accuracy of the model reaches 99.62%, which is excellent compared with the same field. However, when listing the specific distinction of each subclass, the classification performance of the subclass is extremely low. For categories such as rootkit, bufferoverflow, imap, land, loadmodule, and perl, due to the extremely limited data set records, the classification indicators are extremely low, or even completely undetectable. In the network attack simulation, any type of detection failure may have serious consequences.
[0031] Table 2: Classifier multi-classification performance table
[0032] At the same time, due to the influence of the rarity of some types, such indicators are highly volatile. Take loadmodule as an example. There is only one record in the data set. At this time, the test accuracy has only two possibilities, namely 0% or 100%. When describing the classification model at a macro level, the results of loadmodule can only be described as extremely good or extremely poor classification effects. However, there are many such category data, and it is often not appropriate to use existing classification evaluation indicators.
[0033] Therefore, when using data sets to evaluate classification models, the overall evaluation index is not suitable for describing scarce samples, but a data enhancement algorithm is needed to expand the scarce samples and evaluate the performance of the model in all aspects based on a larger balanced number scale. At this time, the generative adversarial network becomes the best data enhancement tool. Through the adversarial training of the generative network and the discriminative network, the generative network can generate realistic data samples, thereby effectively making up for the lack of scarce category samples in the data set. This method not only increases the number of scarce samples, but also retains the diversity of samples, making the classification model more stable and reliable when facing a small number of categories. By introducing the generative adversarial network, we can effectively expand the number of scarce samples without changing the structure of the original data set, so that the performance indicators obtained when evaluating the classification model are more representative. At the same time, the data samples of the generative adversarial network can retain the key features of the original data and avoid the problem of model overfitting caused by simple copying or over-enhancement. Therefore, the application of the generative adversarial network not only solves the limitations of traditional data enhancement methods, but also lays a solid foundation for further improving the generalization ability of classification models.
[0034] Step 102: The target class samples are expanded in number through a generative adversarial network (GAN) model to obtain expanded samples; Figure 3 Schematic diagram of the overall structure of the Generative Adversarial Network (GAN) model in one embodiment of the present invention. Figure 3 As shown, the GAN model generated in this embodiment includes: a decoder, an encoder, a generator and a discriminator; the decoder is connected to the encoder, the encoder is responsible for the dimensionality reduction processing of the target sample, and the decoder is responsible for remapping the target sample reduced by the encoder back to the high-dimensional data space; the Encoder and the Decoder are both responsible for the conversion of high- and low-dimensional feature data, and at the same time use the data condition type to further distinguish normal samples from abnormal samples, thereby further reducing the potential impact of data imbalance from the data input level.
[0035] The generator is connected to the decoder and is used to generate extended samples that meet the conditions from the target samples sent by the decoder; the judger is connected to the generator and is used to judge whether the extended samples generated by the generator meet the conditions, that is, to judge the authenticity of the generated data and whether it meets the conditional constraints. By adding this process of combining dimensionality reduction and restoration with conditions, the key features of the data can be effectively retained and the interference of information imbalance problems on model training can be reduced.
[0036] After receiving the low-dimensional features and condition information processed by the encoder, the generator generates new data samples that meet the conditions. In order to ensure the diversity and authenticity of the generated samples, the generator uses adversarial training to continuously optimize its generation capabilities. The Discriminator is used to distinguish the authenticity of the input samples and determine whether the samples meet the given conditions. In this way, the Discriminator not only improves the ability to identify the generated samples, but also ensures the consistency of the feature distribution between the generated samples and the real data.
[0037] In the data augmentation task, enhancing the diversity of data should be the main goal. Therefore, we conduct a comprehensive comparative analysis of the improvement of the classification task indicators and the similarity between the generated samples and the original samples. The improvement of the classification model indicators proves the effectiveness of the data augmentation algorithm. At the same time, we selected three evaluation indicators of data augmentation: PRD, RMSE and MAE to confirm and quantify the data augmentation effect of CE-GAN. These generation indicators should be kept within a reasonable range, neither too high to lose authenticity nor too low to lose diversity, to ensure that the generated samples achieve the best balance between diversity and authenticity.
[0038] In model training, we introduced a variety of loss functions to constrain the model training effect, namely adversarial loss, reconstruction loss, difference loss and momentary loss. Each loss function plays a key role in different parts of the model.
[0039] Adversarial loss is the core of generative adversarial networks. Through the game between the Generator and the Discriminator, the Generator continuously improves the authenticity of the generated samples, while the Discriminator improves the ability to distinguish between true and false and conditional matching. Specifically, the conditional adversarial loss can be described as shown in Equation 6: (6) in, represents the real data, that is, the target sample, represents a random noise vector, Indicates conditional information. represents a generator, represents the discriminator, Indicates that given data distribution Next, yes and The expected value of the generator is better, and the data distribution is Represents the distribution law of samples in the original data set, and data represents the original data. It is an abstract representation used to refer to the distribution law of target samples in the data set. This law cannot be simply described and represented by functions, etc., so a representative pdata is used.
[0040] The reconstruction loss can ensure effective data dimensionality reduction and restoration between the Encoder and the Decoder. By combining data with conditional information, the distribution gap between normal samples and abnormal samples is widened during the dimensionality reduction process. The reconstruction loss is described as follows: (7) It represents the result after the target sample and the condition are input to the encoder and then to the decoder; the difference loss is used to ensure the diversity of the generated samples, prevent overfitting, and thus lose the meaning of the generated adversarial network, while making the generated samples as real as possible. Its form is shown in formula (8): (8) in, Representation sample and The Euclidean distance between For each sample , calculate it and other samples The minimum distance between It exists in the form of a small negative mean during the overall training process, thereby avoiding the loss of authenticity caused by the generation for the sake of model diversity.
[0041] The momentary loss is used to ensure that the generated samples are similar to the original data as a whole in the low-dimensional space and improve the reliability of the generated data. Its form is shown in formula (9): (9) E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the encoder for the target sample. The whole process is to describe and calculate the distribution difference between the target sample and the generated sample.
[0042] By combining the four loss functions, we can constrain the model's training effect in many aspects, accelerate the model convergence speed, ensure the authenticity and diversity of the generated samples, make a more appropriate trade-off between the two, and improve the quality of CE-GAN's generated samples.
[0043] like Figure 4 As shown in the figure, we have listed the model architecture used by each network in CE-GAN. For the high complexity and high diversity of network attacks, the multi-head attention mechanism of Transformer can flexibly extract rich feature representations of signals from input data. In order to ensure that the Generator and Discriminator in the CE-GAN model have equal capabilities, we use the Transformer architecture for both, so that they have consistent feature extraction and representation capabilities when processing complex data. Through the multi-head attention mechanism, the model can pay attention to different parts of the data at the same time and find hidden attack features in a wider feature space, which is crucial for identifying complex network attack behaviors. In order to evaluate the quality of samples generated by CE-GAN, we selected three indicators commonly used in the field of data augmentation, namely PRD, RMSE, and MAE. They can quantify the results of CE-GAN with formulas, thereby indirectly reflecting the authenticity and diversity of the generated samples.
[0044] 1.PRD PRD is used to measure the similarity between the generated samples and the real samples in feature distribution. By calculating the percentage root mean square difference between the generated samples and the real samples, it is possible to evaluate whether the generated samples maintain authenticity while maintaining diversity. The calculation formula is shown in (10).
[0045] (10) in, represents the real sample, represents the generated sample, PRD is the number of samples. It is sensitive to the deviation of the overall distribution of the generated samples and can reflect the accuracy of the generated samples in the overall distribution. The smaller the value, the higher the authenticity and the lower the diversity.
[0046] 2.RMSE RMSE represents the root mean square error between the generated samples and the real samples, which can reflect the numerical difference between the generated samples and the real samples. Its calculation formula is shown in (11).
[0047] (11) The smaller the RMSE value, the higher the similarity between the generated sample and the real sample. RMSE is more sensitive to the large error values in the generated samples and can effectively capture the large error values in the generated samples.
[0048] 3. MAE MAE usually represents the absolute error between the generated sample and the real sample, which intuitively reflects the quality of the generated sample. The formula is shown in (12): (12) The smaller the MAE value, the higher the quality of the generated samples, and the lower the diversity. MAE is equally sensitive to all error values and is a relatively stable and direct error measure.
[0049] The K-fold validation experiment first verifies the effectiveness of the model, and uses three indicators, PRD, RMSE, and MAE, to verify the effectiveness of the model. The experiments are all expanded with a single type of scarce attack samples, as shown in Table 3. We combine buffer_overflow with normal samples to form new samples. Divide it into K parts, of which K-1 parts are used as training sets and 1 part is used as a test set, so as to cross-validate the effectiveness and versatility of the model. From the perspective of indicators, the average PRD of the network attack samples generated by CE-GAN is 64.3868, the average RMSE is 0.1964, and the average MAE is 0.1264. The overall performance is relatively good, which confirms the effectiveness of the CE-GAN model from the generation indicators.
[0050] Table 3 K-fold experimental verification table of NSL-KDD dataset
[0051] like Figure 5 As shown in the figure, we plotted the loss curve of each loss value of the Generator and the loss value of the Discriminator. The adversarial loss of the Generator rises rapidly in the early stage of training, and the loss of the Discriminator drops rapidly. When it reaches about 400 iterations, the two reach a balance. The Moment loss and the Constrastive loss show a weak adversarial situation in the whole process. One is responsible for enhancing data diversity and the other is responsible for enhancing data authenticity. When the curves of the two are balanced and stable, the model is in a state of retaining diversity on the basis of a relatively realistic model. At this time, the Generator can generate diverse samples that meet the authenticity, thereby effectively expanding the data set.
[0052] In the experiment, we conducted multiple tests on the composition of the generator loss value. The composition of the generator loss value is shown in formula (13), where and The two are used to control the loss value coefficient, generally taken as , at this time, the two are relatively stable and do not have too much impact on the entire training process. When a larger value is taken, the model stability is low and mode collapse problems will occur multiple times. Therefore, the diversity size needs to be controlled within a smaller range to minimize the impact on the model training process and enhance diversity.
[0053] (13) Step 103: Perform network attack detection based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
[0054] The implementation of the present invention introduces the Nash equilibrium concept in game theory, and optimizes the combination strategy of multiple classifiers through integrated learning methods to improve the robustness and performance of the classifier when processing unbalanced data. Furthermore, the introduction of multiple loss function models can constrain the training effect of the model in many aspects, accelerate the convergence speed of the model, and ensure the authenticity and diversity of the generated samples. At the same time, the Transformer architecture is used for the model, so that the model has consistent feature extraction and representation capabilities when processing complex data, that is, target samples. Through the multi-head attention mechanism, the model can pay attention to different parts of the target sample at the same time and find hidden attack features in a wider feature space. Thereby improving the accuracy of processing network attacks.
[0055] In this embodiment, according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample, the target sample in the sample is determined, the number of the samples not classified as the target sample is greater than the number of the target samples, the classification system includes at least a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, and the sample includes network attack information; then, the target class sample is processed by the generative adversarial network GAN model to expand the number of samples to obtain an expanded sample; then, network attack detection is performed based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior. Generate an expanded sample with authenticity and diversity through the generative adversarial network GAN model, which is conducive to finding hidden network intrusion attack behaviors. Thereby improving the accuracy of processing network attacks.
[0056] Figure 6 FIG. 1 is a schematic diagram of a structure of an imbalanced ECG data determination system based on an adaptive generative adversarial network according to an embodiment of the present invention. Figure 6 As shown, the imbalanced ECG data determination system based on adaptive generative adversarial network according to the embodiment of the present invention comprises: a classification module 61, an expansion module 62 and a determination module 63, wherein: A classification module 61, configured to determine a target sample in the sample according to an optimal weight of each classifier in the classification system and a prediction value of each classifier for the sample, the number of the samples not classified as the target samples being greater than the number of the target samples, the classification system comprising at least a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, and the sample comprising network attack information; An expansion module 62 is used to expand the number of target class samples through a generative adversarial network (GAN) model to obtain expanded samples; The determination module 63 is used to perform network attack detection based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
[0057] In this embodiment, according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample, the target sample in the sample is determined, the number of the samples not classified as the target sample is greater than the number of the target samples, the classification system includes at least a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, and the sample includes network attack information; then, the target class sample is processed by the generative adversarial network GAN model to expand the number of samples to obtain an expanded sample; then, network attack detection is performed based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior. Generate an expanded sample with authenticity and diversity through the generative adversarial network GAN model, which is conducive to finding hidden network intrusion attack behaviors. Thereby improving the accuracy of processing network attacks.
[0058] In the embodiment of the present invention, the classification module 61 is also used to classify the samples by a random forest classifier. Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; Gradient boosting classifier for samples Process and obtain the predicted value ;according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier.
[0059] Further, the classification module 61 is also used for The weight of the classifier in the t+1th iteration , and The weight of the classifier in the tth iteration After the absolute value of the subtraction reaches Nash equilibrium, the weight is determined For the The optimal weights of the classifier ,in, ,income , error rate , Indicates The feature vector of the samples, Indicates The true labels of samples, is the indicator function, when Classifier for samples The predicted value and the true label At the same time, The value is 1, otherwise it is 0. The first classifier is the random forest classifier, the second classifier is the extreme random trees classifier, and the third classifier is the gradient boosting classifier.
[0060] Based on the above embodiment, the generative adversarial network GAN model includes: a decoder, an encoder, a generator and a judger; The decoder is connected to the encoder, the encoder is responsible for dimensionality reduction processing of target samples, and the decoder is responsible for remapping the target samples reduced in dimension by the encoder back to the high-dimensional data space; The generator is connected to the decoder and is used to generate an extended sample from the target sample sent by the decoder; The judger is connected to the generator and is used to judge whether the expanded samples generated by the generator meet the conditions; The generative adversarial network GAN model includes an adversarial loss sub-model, a reconstruction loss sub-model, a difference loss sub-model and a momentary loss sub-model; wherein, The adversarial loss submodel Used to improve the authenticity of samples generated by the generator, where represents the target sample, represents a random noise vector, Indicates conditions, represents a generator, represents the discriminator, Indicates that the data distribution Next pair and The expected value of the data distribution Represents the distribution law of the samples of the original data set, and data represents the original data; The reconstruction loss submodel Used to increase the distribution gap between samples in the encoder during dimensionality reduction. It indicates the result after the target sample and condition are input into the encoder and then passed through the decoder; Differential loss sub-model Used to ensure the diversity of generated samples, where Representation sample and The Euclidean distance between For each sample With other samples The minimum distance between A temporal loss sub-model to ensure that the generated samples are similar to the samples in low-dimensional space , E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the target sample after the encoder.
[0061] Furthermore, based on the above embodiment, the generative adversarial network GAN model further includes: a function for measuring the similarity between the generated sample and the sample in feature distribution ,in, represents the target sample, represents the expanded sample, is the sample size.
[0062] The implementation principle and technical effect of this embodiment are Figure 1-Figure 5 The implementation principles and technical effects shown are similar and will not be repeated here.
[0063] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.
Claims
1. A network attack processing method based on zero-sum game, characterized in that: include: Determine a target sample in the sample according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample, wherein each classifier includes at least a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, the sample includes network attack information, and the optimal weight of each classifier includes a value obtained after each classifier iteratively processes the sample to a Nash equilibrium; The target class samples are expanded in number by using a generative adversarial network (GAN) model to obtain expanded samples; Network attack detection is performed based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
2. The zero-sum game-based network attack processing method according to claim 1, characterized in that: The step of determining a target sample among the samples according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample comprises: The samples are classified by random forest classifier Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; The samples are classified by gradient boosting classifier Process and obtain the predicted value ; according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier.
3. The zero-sum game-based network attack processing method according to claim 2, characterized in that: The step of determining a target sample among the samples according to the optimal weight of each classifier in the classification system and the predicted value of each classifier for the sample further includes: No. The weight of the classifier in the t+1th iteration , and The weight of the classifier in the tth iteration After the absolute value of the subtraction reaches Nash equilibrium, the weight is determined For the The optimal weights of the classifier ,in, , Indicates The classifier in The profit in the iterations, the profit in each iteration , error rate , Indicates The feature vector of the samples, Indicates The true labels of samples, is the indicator function, when Classifier for samples The predicted value of With the true label At the same time, The value is 1, otherwise it is 0. The first classifier is the random forest classifier, the second classifier is the extreme random trees classifier, and the third classifier is the gradient boosting classifier.
4. The zero-sum game-based network attack processing method according to claim 3 is characterized in that: The generative adversarial network (GAN) model includes: a decoder, an encoder, a generator and a judger; The decoder is connected to the encoder, the encoder is responsible for dimensionality reduction processing of target samples, and the decoder is responsible for remapping the target samples reduced in dimension by the encoder back to the high-dimensional data space; The generator is connected to the decoder and is used to generate an extended sample from the target sample sent by the decoder; The judger is connected to the generator and is used to judge whether the expanded samples generated by the generator meet the conditions; The generative adversarial network GAN model includes an adversarial loss sub-model, a reconstruction loss sub-model, a difference loss sub-model and a momentary loss sub-model; wherein the adversarial loss sub-model ; Used to improve the authenticity of samples generated by the generator, where represents the target sample, represents a random noise vector, Indicates conditions, represents a generator, represents the discriminator, Indicates that the data distribution Next pair and The expected value of the data distribution Represents the distribution law of the samples of the original data set, and data represents the original data; The reconstruction loss submodel Used to increase the distribution gap between samples during the dimensionality reduction process of the encoder, Indicates the result after the target sample and condition are input to the encoder and then to the decoder, double absolute value is the norm; Differential loss sub-model Used to ensure the diversity of generated samples, where Representation sample and The Euclidean distance between For each sample With other samples The minimum distance between A temporal loss sub-model to ensure that the generated samples are similar to the samples in low-dimensional space , E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the target sample after the encoder.
5. The zero-sum game-based network attack processing method according to claim 4 is characterized in that: The generative adversarial network GAN model also includes: a function for measuring the similarity between the generated sample and the sample in feature distribution ,in, represents the target sample, represents the expanded sample, is the sample size.
6. A network attack processing system based on zero-sum game, characterized in that: include: A classification module, used for determining a target sample in the sample according to an optimal weight of each classifier in the classification system and a predicted value of each classifier for the sample, the number of the samples not classified as the target samples is greater than the number of the target samples, the classifiers at least include a random forest classifier, an extreme random tree classifier and a gradient boosting classifier, the sample includes network attack information, and the optimal weight of each classifier includes a value obtained after each classifier iteratively processes the sample to a Nash equilibrium; An expansion module is used to expand the number of target class samples through a generative adversarial network (GAN) model to obtain expanded samples; The determination module is used to perform network attack detection based on the expanded sample and the sample to determine whether there is a network intrusion attack behavior.
7. The zero-sum game-based network attack processing system according to claim 6, characterized in that: The classification module is also used to classify samples through a random forest classifier. Process and obtain the predicted value ; The samples are classified by extreme random tree classifier Process and obtain the predicted value ; Gradient boosting classifier for samples Process and obtain the predicted value ;according to , determine the processing result of the classification system on the sample Y ,in, is the optimal weight of the random forest classifier, is the optimal weight of the extreme random tree classifier, is the optimal weight of the gradient boosting classifier.
8. The zero-sum game-based network attack processing system according to claim 7, characterized in that: The classification module is also used for The weight of the classifier in the t+1th iteration , and The weight of the classifier in the tth iteration After the absolute value of the subtraction reaches Nash equilibrium, the weight is determined For the The optimal weights of the classifier ,in, , Indicates The classifier in The profit in the iterations, the profit in each iteration , error rate , Indicates The feature vector of the samples, Indicates The true labels of samples, is the indicator function, when Classifier for samples The predicted value and the true label At the same time, The value is 1, otherwise it is 0. The first classifier is the random forest classifier, the second classifier is the extreme random trees classifier, and the third classifier is the gradient boosting classifier.
9. The zero-sum game-based network attack processing system according to claim 8, characterized in that: The generative adversarial network (GAN) model includes: a decoder, an encoder, a generator and a judger; The decoder is connected to the encoder, the encoder is responsible for dimensionality reduction processing of target samples, and the decoder is responsible for remapping the target samples reduced in dimension by the encoder back to the high-dimensional data space; The generator is connected to the decoder and is used to generate an extended sample from the target sample sent by the decoder; The judger is connected to the generator and is used to judge whether the expanded samples generated by the generator meet the conditions; The generative adversarial network GAN model includes an adversarial loss sub-model, a reconstruction loss sub-model, a difference loss sub-model and a momentary loss sub-model; wherein the adversarial loss sub-model ; Used to improve the authenticity of samples generated by the generator, where represents the target sample, represents a random noise vector, Indicates conditions, represents a generator, represents the discriminator, Indicates that the data distribution Next pair and The expected value of the data distribution Represents the distribution law of the samples of the original data set, and data represents the original data; Indicates the noise distribution The conditional distribution Expected value under The reconstruction loss submodel Used to increase the distribution gap between samples during the dimensionality reduction process of the encoder, Indicates the result after the target sample and condition are input to the encoder and then to the decoder; double absolute value is the norm; Differential loss sub-model Used to ensure the diversity of generated samples, where Representation sample and The Euclidean distance between For each sample With other samples The minimum distance between A temporal loss sub-model to ensure that the generated samples are similar to the samples in low-dimensional space , E is the encoder, where x is the target sample, c is the condition, G is the generator, z is the random noise vector, G(z,c) is the output result of the generator, and E(x,c) is the output result of the target sample after the encoder.
10. The zero-sum game-based network attack processing system according to claim 9, characterized in that: The generative adversarial network GAN model also includes: a function for measuring the similarity between the generated sample and the sample in feature distribution ,in, represents the target sample, represents the expanded sample, is the sample size.
Citation Information
Patent Citations
Optimized classification method and optimized classification device based on random forest algorithm
CN105844300A
Integrated learning method and device based on interval optimization
CN108090510A
Detection method based on fusion of simple neural network and extreme gradient boosting model
CN111967343A
Network abnormal flow detection method, model and system
CN112784881A
Android malicious software escape attack enhancement detection method based on anti-purification strategy
CN117494127A
Cited By
Electrocardiosignal classification enhancement method based on tetragonal game adversarial network
CN120788597A
Electrocardiogram signal classification enhancement method based on four-party game adversarial network
CN120788597B