Network abnormal traffic feature screening method and system based on causal genetic algorithm
The causal genetic algorithm is used to screen abnormal network traffic characteristics, solving the problem of detecting unbalanced and redundant information, achieving efficient feature selection and balance improvement, and providing causal explainability and stability.
Patent Information
- Application Number
- CN202410617309.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-06
AI Technical Summary
Existing network attack detection systems are easily affected by noise and redundant features when processing high-dimensional data, resulting in detection imbalance, overfitting and increased computational complexity. They are also unable to effectively distinguish between causal correlations and false correlations, affecting the detection results. Interpretability and stability.
A network abnormal traffic feature screening method based on causal genetic algorithm is used to remove false correlations between features through Fourier transform, calculate the causal correlation weight between features and labels, and use the detection balance index and optimal feature index for iterative optimization , select the optimal feature subset for network anomaly detection.
Effectively remove redundant information, improve detection rate and balance, improve the stability and generalization performance of the attack detection system, provide causal explainability, and improve the detection ability of attack types with a small number of instances.
Smart Images

Figure CN118611907A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network security detection, and in particular to a method and system for screening network abnormal traffic characteristics based on a causal genetic algorithm. Background Art
[0002] Establishing an attack detection system and effectively identifying various network attack behaviors has become particularly important in today's network security.
[0003] However, the latest detection systems only focus on the overall detection accuracy and feature dimensionality reduction of network attacks, while ignoring the two problems of detection imbalance and feature subset optimization. For example, in the existing detection data sets, the number of instances is small due to the difficulty in collecting samples of some attack types, and there are generally problems such as data imbalance (i.e., there are obvious differences in the number of samples of different categories). However, previous feature selection methods often tend to favor the mutual influence between labels and features with a large number of instances, while ignoring the correlation between labels and features with a small number of instances, which aggravates the detection imbalance. At the same time, with the substantial growth of network traffic, the feature information it contains has also increased, but this information is also mixed with more noise and redundant information. However, this information is inextricably linked to useful information, bringing a large number of false correlations, which not only increases the computational complexity and time consumption of attack detection, but also makes the detection results lack causal interpretability (causal interpretability mainly focuses on the interpretability and cause analysis of detection results. It aims to reveal the causal relationship between network attack labels and traffic anomaly features in samples by building detection models, so as to clearly understand the reasons why the model gives a certain detection result), which brings serious challenges to network security defense.
[0004] Since high-dimensional data usually contains a large amount of noise and irrelevant redundant features, this not only increases the computational complexity of the detection system, but also leads to problems such as overfitting and low detection accuracy. Based on this, many researchers have tried to eliminate the adverse effects of noise and redundant features by screening features. First, feature selection can be considered as a problem of target optimization. The method of swarm intelligence to optimize specific targets through mutual cooperation between individuals and screen out the optimal feature subset can be applied to detection and classification. Secondly, methods such as machine learning can enable the model to continuously learn and adapt to the ever-changing network environment, and automatically find rules from the data to extract feature subsets that make the detection and classification performance better. Although methods such as the literature (Zhang, Hao, et al. "A network anomaly detection algorithm based on semi-supervised learning and adaptive multiclass balancing." The Journal of Supercomputing (2023): 1-36.) reduce feature dimensions, calculation and time overhead. However, some methods claim to have screened out the optimal feature subsets, but they do not completely remove features that are spurious-correlated (i.e., features that have no causal relationship with the attack label). They even remove some features that have a true causal relationship with the attack, causing the detection system's performance to overfit or fail to improve to an ideal level.
[0005] In order to solve the problems caused by data imbalance, many studies have tried to solve the imbalance problem by changing the distribution of class samples from the data level. Typically, Liu et al. proposed a new difficult set sampling technology algorithm (see: Liu, Lan, et al. "Intrusion detection of imbalanced network traffic based on machine learning and deep learning." Ieee Access 9 (2020): 7550-7563.), using the Kmeans algorithm to compress the majority of samples in the difficult set to reduce the majority class and achieve class balance. However, artificially synthesized samples are prone to model overfitting problems, and artificially deleting samples is prone to cause important information loss of majority class samples. In order to solve these problems at the data level, Bedi et al. (see: Bedi P, Gupta N, Jindal V. Siam-IDS: Handling class imbalance problem in intrusion detection systems using siameseneural network[J]. Procedia Computer Science, 2020, 171: 780-789.) changed the classification algorithm to make the detection system more focused on the minority class from the algorithm level to achieve detection balance. The system can detect R2L and U2R attacks with a small number of instances in the NSL-KDD dataset without using traditional class balancing techniques. Although paying more attention to minority class samples can effectively avoid overfitting and information loss at the data level, for multi-class problems with a large number of minority classes, some classes cannot be detected, and the accuracy of the majority class cannot be guaranteed.
[0006] Although the development of machine learning and other technologies has improved the adaptability and detection capabilities of traffic anomaly detection, the correlation between network attacks and abnormal features has been discovered at the algorithm level by removing noise information and other methods; to a certain extent, it has solved the problems of sample imbalance and information redundancy at the data level, and has a higher detection rate than previous methods. However, machine learning cannot eliminate the strong false correlation caused by factors such as noise, and cannot decouple the correlation of features, which makes the detection model lack stability; the generation method based on correlation to solve the imbalance of traffic samples brings detection bias and unexplainable problems. The key factor leading to these problems is that the previous detection methods only reasoned based on correlation and ignored causal relationships. This statistical correlation may not actually have causal relationships, but is a strong false correlation. This false relationship not only cannot provide strong decisions because it cannot provide explainability, but also because the false correlation features are expressed differently in different network environments, causing the detection results to change accordingly, causing problems in the robustness, stability, causal interpretability and generalization of the detection method or model. Summary of the invention
[0007] Technical problem to be solved by the present invention: In view of the above-mentioned problems of the prior art, a method and system for screening network abnormal traffic characteristics based on a causal genetic algorithm are provided. The present invention aims to realize the screening of network abnormal traffic characteristics based on a causal genetic algorithm, so that it can not only remove redundant information to improve the detection rate, but also better improve the balance of the attack detection system, and have better stability and generalization performance.
[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for screening network abnormal traffic characteristics based on causal genetic algorithm, comprising: S101, a parent population P consisting of M individuals is initialized and generated according to the traffic characteristics to be screened, where the individuals are chromosomes formed by characteristic coding, and the evolutionary iteration number Gen is 1; S102, randomly select N individuals from the parent population P to form the offspring population S; S103, merging the parent population P and the offspring population S to generate a population Q containing M+N individuals; S104, first determine that all individuals in the population Q have been sorted. If they have not been sorted, first calculate the fitness of all individuals in the population Q, including: find the causal association weight W between the feature and the result label according to causal reasoning, decode the parent population P, select features for training and detection to find the detection balance index and the optimal feature index, and finally use the detection balance index, the optimal feature index and the causal association weight W together as a multi-dimensional fitness index; then constrain and dominate all individuals based on the fitness of the individual and the associated reference point; S105, selecting N individuals from the sorted population Q to form a new parent population P; S106, determining that the evolution iteration number Gen is less than a preset threshold Gen max Is it true? If so, increase the evolution iteration number Gen by 1 and jump to step S102; otherwise, use the finally selected individual as the optimal traffic feature for network anomaly detection, and end and exit.
[0009] Optionally, before step S101, the process further includes removing false correlations between flow characteristics by converting characteristic values of flow characteristics through Fourier transform, and the calculation function expression of the characteristic values of flow characteristics through Fourier transform is as follows: , In the above formula, The space of functions representing random Fourier features, ∈ , is the characteristic value of the flow characteristic, is the Fourier transform eigenvalue, and is a random number, a random number Sampling from a standard normal distribution, is 0,1 distribution, uniform is the probability distribution function, express from The independence test statistic between all two traffic features A and B is calculated according to the following formula: : , In the above formula, Express request The norm of represents the partial cross-covariance matrix, and Represents the Fourier transform transformed eigenvalues of two eigenvalues A and B respectively; if the independence test statistic between flow characteristics A and B If the value of is equal to 0, the two traffic features A and B are determined to be independent, otherwise the traffic features A and B are determined to be not independent, and finally the traffic features that are not independent of other traffic features are removed.
[0010] Optionally, in step S104, the causal association weight W between the feature and the result label is obtained according to causal reasoning: , In the above formula, is the number of features, Indicates that except After the first feature is set to normal, the values of other features remain unchanged and except for the The value of each feature remains unchanged, and the remaining features are intervened and set to normal. Indicates that except The expected value of the result label after the feature is intervened and set to normal, and the values of other features remain unchanged, Indicates that except The value of each feature remains unchanged, and the remaining features are set to normal. Represents a diagonal matrix , ~ are the causal association weights of the 1st to pth features, respectively. Indicates The serial number of the feature; Indicates that except Except for one feature that was set to normal by intervention, the values of other features remained unchanged; Indicates that except Except for the value of one feature that remains unchanged, the other features are set to normal.
[0011] Optionally, in step S104, when selecting features for training and detection to obtain a detection balance index and an optimal feature index, the calculation function expression of the detection balance index is: , In the above formula, To detect the balance index, The closer it is to 0, the more serious the detection imbalance problem is. is the type of anomaly to be detected, For the The detection F1 score expected to be achieved by class samples, For the The actual detection F1 score of the class sample; the calculation function expression of the optimal feature index is: , In the above formula, is the optimal characteristic index, The closer it is to 0, the worse the ability of the intrusion detection system to screen causal features is, and vice versa; is the overall F1 score of the detection system, Representation characteristics The characteristic dimension, feature represents the causal feature set, Features The feature dimensions after filtering, Features The feature dimensions after filtering, Representation characteristics The characteristic dimension, feature represents the noise feature set.
[0012] Optionally, performing constraint-dominated sorting on all individuals based on the fitness of the individuals and the associated reference points in step S104 refers to performing constraint-dominated sorting on all individuals using the NSGAIII algorithm based on the fitness of the individuals and the associated reference points.
[0013] Optionally, the determining of the associated reference point includes: S201, based on the dimension μ of the fitness and the number h of reference points in each dimension, define reference points that are equally inclined for all target axes on the normalized hyperplane of the fitness, and the number of reference points is: , In the above formula, represents the number of reference points, Indicates from Select The value of the combination of targets, It refers to the uniformity of the distribution of reference points in each target dimension. These reference points are used to guide the search direction of the algorithm. m is the number of targets included in the fitness. S202, connecting each reference point with the origin to form a reference line; S203, first calculate each individual according to the following formula Horizontal and vertical distances to each reference line: , , In the above formula, Represents an individual To Reference lines The horizontal distance is the performance indicator, For reference line The coordinate vector of For performance indicators With reference line The inner product of Represents an individual To Reference lines The vertical distance of each individual The vertical distance to each reference line is used to find the distance from the individual The nearest reference point as an individual Key reference points.
[0014] Optionally, in step S105, selecting N individuals from the sorted population Q to form a new parent population P includes: S301, for the sorted population Q, select individuals from the top-ranked regions according to the constraint dominance relationship and put them into the new parent population P, until the number of individuals in the new parent population P reaches ; S302, remember The number of individuals in the new parent population P is first The last non-dominated layer of is the previous non-dominated layer, and the number of individuals in all non-dominated layers is , the first non-dominated layer The number of individuals is , if , then stop the selection, and the new parent population P satisfies , otherwise from the last non-dominated layer Region Selection individuals, so that the number of individuals in the new parent population P is equal to indivual.
[0015] In addition, the present invention also provides a network abnormal traffic feature screening system based on a causal genetic algorithm, comprising a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the network abnormal traffic feature screening method based on a causal genetic algorithm.
[0016] In addition, the present invention also provides a computer-readable storage medium, in which a computer program / instruction is stored, and the computer program / instruction is programmed or configured to execute the network abnormal traffic feature screening method based on the causal genetic algorithm through a processor.
[0017] In addition, the present invention also provides a computer program product, including a computer program / instruction, which is programmed or configured to execute the network abnormal traffic feature screening method based on the causal genetic algorithm through a processor.
[0018] Compared with the prior art, the present invention mainly has the following advantages: the method of the present invention comprises firstly generating an initial parent population according to the feature dimension; secondly using Fourier feature transformation to remove false correlations between features and then calculating the causal effect weights between features and labels based on causal reasoning; then defining the detection balance index, the optimal feature subset index and the causal effect weight as fitness indicators for iterative optimization; finally selecting individuals based on the non-dominated sorting of reference points to form a new population, repeating the iterative optimization and using the individuals finally selected as the screened optimal traffic features for network anomaly detection. The present invention can realize the screening of network anomaly traffic features based on causal genetic algorithm, so that it can not only remove redundant information to improve the detection rate, but also better improve the balance of the attack detection system, and has better stability and generalization performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.
[0020] Figure 2 Schematic diagram of the structure of a network attack structural causal model (SCM) in an embodiment of the present invention.
[0021] Figure 3 Schematic diagram of the process of population selection in an embodiment of the present invention.
[0022] Figure 4 Schematic diagram of reference point distribution in an embodiment of the present invention.
[0023] Figure 5 It is the detection performance of CICDDOS2019 after deleting the weak strength features in the embodiment of the present invention.
[0024] Figure 6 This is the detection performance of DoHBrw-2020 after deleting the weak strength features in an embodiment of the present invention.
[0025] Figure 7 Detection performance of NSL_KDD after deleting weak intensity features in the embodiment of the present invention.
[0026] Figure 8 It is the 2-classification accuracy of the IDS in the embodiment of the present invention on the CICDDoS2019 dataset.
[0027] Fig. 9 It is the 2-classification accuracy of IDS in the DoHBrw-2020 dataset in the embodiment of the present invention.
[0028] Fig.10 It is the 2-classification accuracy of IDS in the NSL_KDD dataset in the embodiment of the present invention.
[0029] Fig.11It is the multi-classification (including 11 types of attacks) accuracy of the IDS in the CICDDoS2019 dataset in the embodiment of the present invention.
[0030] Fig.12 This is the multi-classification accuracy of the IDS in the DoHBrw-2020 dataset in an embodiment of the present invention.
[0031] Fig.13 It is the multi-classification accuracy of IDS in the NSL_KDD dataset in the embodiment of the present invention.
[0032] Fig.14 It is the balanced performance index of IDS in the CICDDOS2019 dataset in the embodiment of the present invention.
[0033] Fig.15 It is the balanced performance indicator of the IDS in the DoHBrw-2020 dataset in an embodiment of the present invention. Fig.16 It is the balance performance index of the IDS in the NSL_KDD data set in the embodiment of the present invention. DETAILED DESCRIPTION In order to improve the detection accuracy of various samples and solve the detection imbalance, and to eliminate noise information and redundant information to screen out the optimal causal feature subset to improve the overall detection accuracy and provide a certain causal explainability, inspired by causal reasoning and NSGA III algorithm, this paper proposes a network abnormal traffic feature screening method based on causal genetic algorithm (CNSGA). Figure 1 As shown, the network abnormal traffic feature screening method based on the causal genetic algorithm in this embodiment includes: S101, a parent population P consisting of M individuals is initialized and generated according to the traffic characteristics to be screened, where the individuals are chromosomes formed by characteristic coding, and the evolutionary iteration number Gen is 1; S102, randomly select N individuals from the parent population P to form the offspring population S; S103, merging the parent population P and the offspring population S to generate a population Q containing M+N individuals; S104, first determine that all individuals in the population Q have been sorted. If they have not been sorted, first calculate the fitness of all individuals in the population Q, including: find the causal association weight W between the feature and the result label according to causal reasoning, decode the parent population P, select features for training and detection to find the detection balance index and the optimal feature index, and finally use the detection balance index, the optimal feature index and the causal association weight W together as a multi-dimensional fitness index; then constrain and dominate all individuals based on the fitness of the individual and the associated reference point; S105, selecting N individuals from the sorted population Q to form a new parent population P; S106, determining that the evolution iteration number Gen is less than a preset threshold Gen max Is it true? If so, increase the evolution iteration number Gen by 1 and jump to step S102; otherwise, use the finally selected individual as the optimal traffic feature for network anomaly detection, and end and exit.
[0034] The network abnormal traffic feature screening method (CNSGA) based on the causal genetic algorithm in this embodiment is divided into three steps: population generation, fitness calculation and non-dominated sorting selection. The first step is the generation of the population: randomly initialize the feature set as the parent population, and then generate a new population by merging and selecting. The second step is fitness calculation: first, the features are made independent of each other through random Fourier feature transformation, and then the causal weight W is calculated through causal reasoning. Secondly, the feature subset is selected according to the product of W and the random probability, and then the imbalance index is calculated, and the feature dimension, imbalance index and causal weight are used as the three goals of population fitness. The third step is non-dominated sorting selection: all sequences are sorted according to the fitness of the second step using the non-dominated sorting method based on the reference point, and then the parent population of the next generation is selected according to the sorting result. The above three steps are repeated until the preset number of iterations is reached or the fitness of the sequence no longer changes.
[0035] In this embodiment, population generation includes generating an initial population and iteratively generating a new population. (1) The main problem to be solved in generating the initial population is the optimization problem of the feature subset. First, the features are encoded into gene individuals and made to obey the {0, 1} distribution. In the genetic algorithm, each individual is composed of a chromosome representing a gene set. Chromosomes can exist in many forms. For example, a chromosome can be represented as a binary string, in which each bit represents a gene. Secondly, according to the encoded gene individuals, the chromosomes are composed, such as Then, each individual is integrated into ,…, etc. (2) When iteratively generating a new population, N individuals are randomly selected to form a population Q with M+N individuals. Then, based on the sorting selection of the reference point, Q is sorted according to fitness, and M individuals are selected to generate a new parent population. This cycle repeats so that the population includes various situations, the target value of the individual is closer to the optimal value, and the average target value continues to increase. Until the optimal solution is found or a certain limit is reached, the fitness of the population no longer changes. At this time, the iterative process converges and the algorithm ends.
[0036] The fitness of a population (see: Gen, Mitsuo, and Lin Lin. "Genetic algorithms and their applications." Springer handbook of engineering statistics. London: Springer London, 2023. 635-674.) refers to a measure of whether it has a survival advantage in the population. The fitness of this embodiment mainly refers to the detection balance index, optimal feature index and CCW. See Figure 1 First, the traffic data set is preprocessed to make its features independent of each other to facilitate the calculation of causal effects. Secondly, the causal weight W between the feature and the result label is obtained based on causal reasoning, the parent population P is decoded, and features are selected for training and detection to obtain the detection balance index and the optimal feature index. Finally, the detection balance index, the optimal feature index and the causal weight W are combined to obtain the fitness index.
[0037] In order to eliminate the noise characteristics caused by the complex dependencies between the various dimensional features in the detection model such as the deep network With label In this embodiment, it is proposed to map the flow characteristics to a high-dimensional space by random Fourier characteristics to eliminate the linear correlation between new characteristics and remove the false correlation. Specifically, before step S101 of this embodiment, it also includes removing the false correlation between the flow characteristics by converting the characteristic value of the Fourier transform of the flow characteristics, and the calculation function expression of the Fourier transform conversion characteristic value of the flow characteristics is as follows: , In the above formula, The space of functions representing random Fourier features, ∈ , is the characteristic value of the flow characteristic, is the Fourier transform eigenvalue, and is a random number, a random number Sampling from a standard normal distribution, is 0,1 distribution, uniform is the probability distribution function, express from The independence test statistic between all two traffic features A and B is calculated according to the following formula: : , In the above formula, Express request The norm of represents the partial cross-covariance matrix, and Represents the Fourier transform transformed eigenvalues of two eigenvalues A and B respectively; if the independence test statistic between flow characteristics A and B If the value of is equal to 0, the two traffic features A and B are judged to be independent, otherwise the traffic features A and B are judged to be not independent, and finally the traffic features that are not independent of other traffic features are removed. G is sampled from the standard normal distribution, and from Then, the independence test statistic is Defined as the Frobenius norm of the partial cross-covariance matrix, is always non-negative. When the two variables decrease to 0, and tend to be independent. It can effectively measure the independence between random variables.
[0038] Regarding the causal correlation weight (CCW), in this embodiment, there are: Definition 3( Operation): It means changing a certain condition while keeping other conditions unchanged to see the change of the result label to determine whether there is a causal relationship between the two.
[0039] For example, commonly used Express Causally intervene to make it equal to a specific number or follow a certain distribution; , indicating After intervention The distribution of .So , Before intervention The distribution of F at time .
[0040] See POM (see
[28] Imbens, Guido W. "Potential outcome and directed acyclic graph approaches to causality: Relevance for empirical practice in economics." Journal of Economic Literature 58.4 (2020): 1129-1179.), this example assumes that network attack A is related to a single traffic feature. The causal effect between for: , In the above formula, Represents network attack A and single traffic characteristics The causal effect between , For After intervention The distribution of For After intervention Theoretically, if the normal traffic characteristics and noise characteristics The independence relationship is stable, then: , In the above formula, for_ and The expected value of attacking A under the condition, for_ The expected value of attacking A under the condition, For The expected value of attacking A under the condition. In general, A and No matter, It is only related to the environment. If A is ignored, the above formula can be simplified as follows: , In the above formula, for and The expected value of for The expected value of for expected value.
[0041] In the actual sample set, due to false associations and are not independent. Therefore, in order to make the above equation valid in real samples, weights are added to the features so that and Stay independent: , In the above formula, for and The weighted expected value, for , ~ are the causal association weights of the 1st to pth features, respectively. for The weighted expected value, for The weighted expected value, is a row of p-dimensional weights, and T is the transposition function. The causal effect of F on A can be estimated by comparing the mean differences between intervention and non-intervention. and , can be obtained through The causal association weight W is learned by operation. In step S104 of this embodiment, the causal association weight W between the feature and the result label is obtained according to causal reasoning: , In the above formula, is the number of features, Indicates that except After the first feature is set to normal, the values of other features remain unchanged and except for the The value of each feature remains unchanged, and the remaining features are intervened and set to normal. Indicates that except The expected value of the result label after the feature is intervened and set to normal, and the values of other features remain unchanged, Indicates that except The value of each feature remains unchanged, and the remaining features are set to normal. Represents a diagonal matrix , ~ are the causal association weights of the 1st to pth features, respectively. Indicates The serial number of the feature; Indicates that except Except for one feature that was set to normal by intervention, the values of other features remained unchanged; Indicates that except Except for the value of one feature that remains unchanged, the other features are set to normal. , then the function expression of the causal association weight W between the feature and the result label obtained by causal reasoning in step S104 can be expressed as the loss function : , because , in the above formula represents the expected value of the empty set. If the loss function What I learned After assigning causal weights to samples: , If the above formula holds, then = 0, so it can be considered is the noise characteristic, is a causal feature.
[0042] Detection imbalance problem: Due to the difficulty in collecting abnormal samples such as rare attacks or zero-day vulnerabilities, there is a serious class imbalance problem in the training samples. This imbalance problem will cause the existing detection methods to overfit the majority class samples and underfit the minority class samples. When deployed in an actual detection environment, this problem makes it impossible to effectively detect rare types with a small number of instances, which seriously threatens the security of the network. In order to solve the problem of detection imbalance, this embodiment verifies the balance of the detection system by defining a detection balance index.
[0043] Definition 1 (Detection Balance Index): It refers to the sum of the degree to which the detection accuracy of various types of samples deviates from the expected accuracy.
[0044] In step S104 of this embodiment, when selecting features for training and detection to obtain the detection balance index and the optimal feature index, the calculation function expression of the detection balance index is: , In the above formula, To detect the balance index, The closer it is to 0, the more serious the detection imbalance problem is. is the type of anomaly to be detected, For the The detection F1 score expected to be achieved by class samples, For the The actual detection F1 score of class samples; The square root is taken because its value is less than 1. Therefore, if the detection accuracy of a certain category deviates more, the value will be closer to 1 after the square root, increasing the sensitivity to samples with low detection accuracy.
[0045] In order to avoid the influence of redundant information, as shown in the following formula, it is necessary to optimize the features to obtain the optimal causal feature subset.
[0046] , In the above formula, in the above formula, is the filtered causal feature subset, is the dimension of the causal feature, is the calculation method for whether the feature is selected, Representation characteristics Not selected, otherwise the feature In order to enable the detection system to both remove noise features and train with a true causal feature subset to improve detection efficiency and accuracy, the optimal feature index is defined.
[0047] Definition 2 (optimal feature index): refers to the subset of causal features selected in the detection system. It is an evaluation index of whether this subset can enable the detection system to achieve the highest detection accuracy and the optimal balance index.
[0048] The calculation function expression of the optimal characteristic index in this embodiment is: , In the above formula, is the optimal characteristic index, The closer it is to 0, the worse the ability of the intrusion detection system to screen causal features is, and vice versa; is the overall F1 score of the detection system, Representation characteristics The characteristic dimension, feature represents the causal feature set, Features The feature dimensions after filtering, Features The feature dimensions after filtering, Representation characteristics The characteristic dimension, feature represents the noise feature set. and Square, because the primary task of the detection system is detection accuracy and detection balance, through square can improve sensitivity in both aspects. This indicates that while ensuring feature accuracy, the fewer causal feature dimensions the better. This indicates that the noise characteristics should be eliminated as much as possible.
[0049] Figure 2 The structural diagram of the structural causal model (SCM) of network attacks in the embodiment of the present invention includes a network attack layer A and a traffic feature layer F. The traffic feature of the traffic feature layer F consists of causal features that are causally related to the network attack layer A. and noise features that are only spuriously associated with A AFS is the set of all features, OFS is the optimal feature subset, and RFs is redundant information. Figure 2 In the previous dimensionality reduction methods, either causal features and noise features cannot be distinguished, resulting in false associations, such as >; Either it cannot distinguish between redundant information and noise information, which slows down the calculation process of the detection system, such as <A >, which will affect the robustness and stability of the detection system.
[0050] In order to select a suitable feature subset for training, this embodiment performs feature screening based on the following rules: Assuming that the number of populations is ,The number of traffic features to be detected is , Indicates The first Individuals, Each individual uses So each individual , . The selected features are: , In the above formula, express The feature subset composed of the selected features, mod represents the remainder function, .
[0051] Population selection is to select N better individuals to form a new population after the parent generation and the offspring generation merge into a population of size M+N. Figure 3 As shown, in this embodiment, the parent generation and the offspring generation are first merged into a new population Q. Then check whether all individuals in the population Q have been sorted. If not, calculate the fitness value. Next, divide the reference line according to the four goals of fitness and find relevant reference points. Finally, constrained control sorting is performed on all individuals based on fitness and associated reference points, and the sorting selection method is the same as the NSGAIII algorithm. If it has been sorted, the parent population of the new generation is selected according to the Niche-Preservation operation.
[0052] In this embodiment, the reference point set to be used in each generation is determined according to the NSGAIII algorithm. The NSGAIII algorithm first defines reference points on the normalized hyperplane that are equally inclined to all target axes. Assume is a dimension of the fitness target space, then all reference points are in -1-dimensional hyperplane. In this embodiment, the determination of the associated reference point includes: S201, based on the dimension μ of the fitness and the number h of reference points in each dimension, define reference points that are equally inclined for all target axes on the normalized hyperplane of the fitness, and the number of reference points is: , In the above formula, represents the number of reference points, Indicates from Select The value of the combination of targets, It refers to the uniformity of the distribution of reference points in each target dimension. These reference points are used to guide the search direction of the algorithm. m is the number of targets included in the fitness. For example, the fitness target in this embodiment can be known as , then assume , according to the above formula, 21 reference points are generated, and the reference points form a triangle. Figure 4 As shown, and The reference points created when are widely and evenly distributed on the entire normalized hyperplane; S202, connecting each reference point with the origin to form a reference line; S203, first calculate each individual according to the following formula Horizontal and vertical distances to each reference line: , , In the above formula, Represents an individual To Reference lines The horizontal distance is the performance indicator, For reference line The coordinate vector of For performance indicators With reference line The inner product of Represents an individual To Reference lines The vertical distance of each individual The vertical distance to each reference line is used to find the distance from the individual The nearest reference point as an individual Key reference points.
[0053] Constraint control is based on the reference point to the target space Divide it into multiple sub-regions, then use the objective function value of the infeasible solution to determine the sub-region it belongs to, and evaluate its sparsity based on the niche mechanism. The constraint dominance relationship is defined as follows: for Reference lines, , given any two and If the following two conditions are met, it can be considered Dominate .
[0054] (I) For , both and Established.
[0055] (II) , so that or Established.
[0056] The objective function value of the infeasible solution can reflect the position of the infeasible solution in the target space. The distribution of its position has an important influence on the diversity of the population. Therefore, it is necessary to select infeasible solutions in sparse areas to improve the diversity of the population.
[0057] The main purpose of associating reference points is to obtain the mapping relationship between individuals and response reference points so that the population can evolve in a better direction. Figure 4 First, we create an "ideal" hyperplane according to the fitness target, that is, the Pareto frontier we are looking for; then we create and associate reference points on the "ideal" hyperplane to build a "mapping relationship" between the individuals in the population and the reference points; finally, the population continues to evolve in the direction of the Pareto frontier. To associate reference points, we first need to calculate the vertical distance from the chromosome to the reference line. To Reference lines Horizontal distance and vertical distance The calculation formula of is as shown in step S203. For reference line The coordinate vector of ; For performance indicators With reference line The inner product of the reference point needs to use the vertical distance Find the chromosome The nearest reference point. At this time, the horizontal distance from the individual to the associated reference point It can characterize its convergence. The smaller its value, the better the convergence. The vertical distance from the individual to the associated reference point Characterizes its diversity, the smaller the value, the better the diversity.
[0058] In step S105 of this embodiment, selecting N individuals from the sorted population Q to form a new parent population P includes: S301, for the sorted population Q, select individuals from the top-ranked regions according to the constraint dominance relationship and put them into the new parent population P, until the number of individuals in the new parent population P reaches ; S302, remember The number of individuals in the new parent population P is The last non-dominated layer of is the previous non-dominated layer, and the number of individuals in all non-dominated layers is , the first non-dominated layer The number of individuals is , if , then stop the selection, and the new parent population P satisfies , otherwise from the last non-dominated layer Region Selection individuals, so that the number of individuals in the new parent population P is equal to indivual.
[0059] In order to determine whether the method (CNSGA) of this embodiment can effectively eliminate the interference of redundant and noisy information under the guidance of causal correlation weight (CCW) and quickly iterate the optimal population to improve the balance of the detection system and provide the causal interpretability of the detection results, this embodiment first introduces in detail three network anomaly detection data sets representing real network environments, and then uses random Fourier features to remove false correlations between features and uses causal reasoning to calculate the causal correlation weight (CCW) between features and labels to improve the causal interpretability of the detection model. Then, CCW guides NSGAIII to quickly iterate and eliminate the interference of redundant and noisy information to improve detection accuracy. Finally, the performance of CNSGA in removing redundant information and detecting balance is analyzed by defining two indexes.
[0060] Network intrusion detection datasets can be divided into seven categories: datasets based on network traffic, datasets based on power grids, and datasets based on Internet traffic. The data set used to verify the performance of the algorithm in this embodiment is mainly based on the data set of network traffic. The commonly used data sets include: CICDDoS2019 (see the literature: Sharafaldin, Iman et al. Developing Realistic Distributed Denial of Service (DDoS) Attack Dataset and Taxonomy. 2019 International Carnahan Conference on Security Technology (ICCST) (2019): 1-8.), DoHBrw-2020 (see the literature: Mohammadreza MontazeriShatoori,Logan Davidson, Gurdip Kaur. Detection of DoH Tunnels using Time-seriesClassification of Encrypted Traffic. The 5th IEEE Cyber Science and Technology Congress, Calgary, Canada, August 2020.) and NSL-KDD (see the literature: IbrahimL M, Basheer DT, Mahmod M S. A comparison study for intrusion database (Kdd99, Nsl-Kdd) based on self-organization map (SOM) artificial neuralnetwork. Journal of Engineering Science and Technology, 2013, 8(1): 107-119.) Data set.
[0061] In order to use various algorithms more effectively, this embodiment uses Python to implement the method of this embodiment. The hardware and software specifications are shown in Table 1.
[0062] Table 1: Hardware and software specifications
[0063] Since the amount of data in the data set is large enough, this embodiment selects about 50% of the data as the test set. Therefore, in this experiment, the 4 data sets are randomly divided into training data sets and test data sets in a 50:50 ratio. The experimental results are analyzed as follows: a) Comparative analysis of the strength of association and the strength of causal effect.
[0064] In order to intuitively show the difference between causal association and correlation in selecting features, in this embodiment, Tables 2-4 show the ranking of features of four data sets by feature importance calculated by CCW and correlation. It is assumed that features with causal weights less than 1% of the average value are noise features. Figure 5-7 It is the detection performance after deleting the noise features or unimportant features considered by the causal effect and association relationship. Causality Delete 1 and Causality Delete 5 mean deleting the 1-dimensional or 5-dimensional features with the lowest weight ranking based on the causal effect strength, while Association deletion 1 and Association deletion 5 mean deleting the unimportant 1-dimensional or 5-dimensional features based on the association relationship.
[0065] Table 2: Causal weight and correlation weight ranking of CICDDOS2019
[0066] As shown in Table 2, the causal effect values of 21-dimensional features such as Flow Duration in the CICIDS2019 dataset are all greater than 600, while the causal effect values of 6-dimensional features such as Bwd Packet Lengrh Std are all less than 3. However, in the calculation of feature importance, that is, the correlation relationship, Bwd packet / s is considered to be the fourth most important, with an impact factor of up to 1896, while CCW considers it to be a noise feature with a causal effect of only 3. As shown in Table 2, the causal weights of 6-dimensional features such as Bwd Packet Lengrh Std are far less than 1% of the average causal effect strength, and are noise features. So, Figure 5 As shown in the figure, when the 1D and 5D noise features are deleted, the detection performance is improved to a certain extent, among which the detection accuracy of Causality Delete 1 is improved by 0.01%, β is improved by 0.5%, and γ is improved by 0.1%. However, after deleting unimportant features based on association relationships, there is a certain degree of decline.
[0067] Table 3: Causal weight and correlation weight ranking of DoHBrw-2020.
[0068]
[0069] As shown in Table 3, in the DoHBrw-2020 dataset, the causal weights of 23-dimensional features such as SourcePort are all greater than 750, while the causal weights of 6-dimensional features such as Response Time / Time Variance are all less than 4, and are considered to be noise features. However, in feature importance, Response Time / Time Median and Response Time / Time Mode are ranked second and fifth, respectively, with impact factors as high as 713 and 604, respectively, while CCW considers them to be noise features with a causal effect of only 4. As shown in Table 3, the causal effect strength of Response Time Coefficient of Variation is 0, so in Figure 6 The detection performance of Causality Delete 1 is significantly improved, with a detection improvement of 0.7%, β improvement of 2%, and γ improvement of 0.01%. The causal weights of the six-dimensional features such as Bwd Packet Lengrh Std are much smaller than the average causal effect strength, and are noise features. Therefore, when the five-dimensional noise features are deleted, the detection performance remains at a relatively stable level. However, the detection performance of deleting the five-dimensional unimportant features based on the association relationship is significantly reduced, and the detection performance of each item is reduced by about 5%.
[0070] Table 4: Causal weight and correlation weight ranking of NSL_KDD
[0071] As shown in Table 4, after the calculation of causal effects, the causal weights of 7-dimensional features such as Dst Bytes and Src Bytes are much greater than the average causal effect strength of other features. The 23-dimensional features such as Wrong Fragment are smaller than the average causal effect strength, while Is Guest Login is much smaller than the average (<1%*average value). As shown in Table 4, the causal weights of Is Guest Login and is_sm_ips_ports are much smaller than their respective average causal effect strengths, so their detection performance remains basically unchanged after deletion. Figure 7 The detection performance of NSL_KDD after deleting the weak intensity features in the embodiment, Figure 8 is the 2-class classification accuracy of IDS in the CICDDoS2019 dataset in this example. However, features such as Wrong Fragment and dur are only smaller than the average causal effect strength, so Figure 7 As shown in the figure, after deleting the 5-dimensional features, the detection performance decreases, which is similar to the detection performance after deleting features based on association relationships.
[0072] In summary, the causal correlation weight (CCW) can effectively calculate the causal effect between features and network attack labels, and effectively remove noise features with causal effect strength far below the average through the causal effect, thereby improving detection performance. The feature importance calculated based on association reasoning is only the correlation between features and network attacks, which contains false correlations and does not represent the true causal relationship. Therefore, when removing so-called unimportant features, important causal features may be deleted. For example, in CICDDOS2019, the second-to-last ACK Flag Count, the least important feature, ranks as high as 15th in the causal weight ranking, so the detection performance drops significantly in Association deletion 5.
[0073] like Figures 9 to 14 As shown, in this experiment, the method of this embodiment (CNSGA) and the following existing methods are mainly compared: Attack Detection based on DNA Computing(ADDC (See reference: Zeng, Zengri, et al. "Towards Intelligent Attack Detection Using DNA Computing." ACM Transactions on Multimedia Computing, Communications and Applications 19.3s(2023): 1-27.), NSGA III (See reference: Yingying, Zhu, Junwei. An improved NSGA-III algorithm for feature selection used in intrusion detection. Knowledge-Based Systems, 2017.), hyper-parameter optimization (Random Search (RS) (See reference
[11] Zeng, Zengri, Wei Peng, and Baokang Zhao. "Improving the accuracy of network intrusion detection with causal machine learning." Security and Communication Networks 2021 (2021): 1-18.), Anneal, TPE), machine learning(K-Nearest Neighbor (KNN), Random Forest (RF)) plus Feature Selection(Information Gain-based Feature Selection (IGFS), Correlation-based Feature Selection (CFS)) consisting of RS-KNN-CFS, Anneal-KNN-CFS, TPE-KNN-CFS, RS-KNN-IGFS, Anneal-KNN-IGFS, TPE-KNN-IGFS, RS-RF-CFS, Anneal-RF-CFS, TPE-RF-CFS, RS-RF-IGFS, Anneal-RF-IGFS, TPE-RF-IGFS (See reference: M. N. Injadat, A.Moubayed, ABNassif. Multi-stage optimized machine learning framework for network intrusion detection. IEEE Transactions on Network and Service Management, vol. 18, no. 2, 2020.), GMGWO-ECAE-Machine Learning (see reference: Moizuddin MD, Jose M V. A bio-inspired hybrid deep learning model for network intrusion detection. Knowledge-Based Systems, 2022, 238: 107894.) and Bayesian and Roughset approach (BRA) (see reference: A. Moubayed, M. Injadat, A. Shami. Relationshipbetween student engagement and performance in e learning environment usingassociation rules. in 2018 IEEE World Engineering EducationConference(EDUNINE), Mar. 2018.) and other methods have the detection accuracy of each attack label in the four major data sets. Among them. Figure 9-11 It is the detection accuracy of normal and abnormal samples as well as the overall samples in the binary classification. The binary classification is divided into normal type and abnormal type. The abnormal type regards all attack types as one type of data. Figure 12-14 It is the detection accuracy of each attack label and the overall sample in multi-class classification. Multi-classification refers to normal types and various attack types.
[0074] like Figure 9-11 As shown in the figure, in the binary classification, the detection performance of the method in this embodiment (CNSGA) is one of the best compared with other methods, achieving effective detection of abnormal samples and ensuring the lowest false positive rate. Fig. 9 As shown in the figure, in the CICDDOS2019 dataset, the detection rates of CNSGA and ADDC for both normal and abnormal samples are close to 100%, and the improvement in abnormal detection rate is >2% compared to the worst BRS method. Fig.10As shown in the figure, in the DoHBrw-2020 dataset, the overall accuracy is improved by about 0.5% compared to the best ADDC, and the detection rate of normal samples is increased by nearly 1%. Fig.11 As shown in the figure, CNSGA has a slight improvement over the best ADDC in NSL_KDD, but its overall performance is improved by >4% on average compared to BRS. It can be seen that the evolution of the genetic algorithm guided by the causal effect can effectively distinguish normal samples from abnormal samples in binary classification detection. Fig.10 As shown, since the number of abnormal samples in the DoHBrw-2020 dataset is significantly less than that of normal samples, it is a severely unbalanced sample. The ratio of normal samples to abnormal samples is 141696:1980. Therefore, detection methods such as KNN, GMGWO and Anneal cannot effectively detect abnormal samples, but the method in this embodiment (CNSGA) can effectively detect abnormal samples, and its detection accuracy is close to 100%, which effectively realizes balanced detection of unbalanced samples.
[0075] like Figure 12 to Figure 14 As shown in the figure, in multi-class classification, whether it is the overall detection accuracy or the detection rate of different attack types, the method in this embodiment (CNSGA) can achieve a good detection rate and solve the problem of detection imbalance. Fig.12 As shown in the figure, in CICDDOS2019, detection methods such as RS-KNN (RF), Anneal-KNN (RF), and TPE-KNN (RF) were unable to effectively detect up to 7 types of network attacks, including DNS, LDAP, NTP, and ADDC. However, except for UDP, which was less than 60%, the detection rate of CNSGA for both normal and abnormal samples was >70%, effectively achieving effective detection of various samples, and detecting 6 more network attack samples than other methods. Fig.13 As shown in the figure, in DoHBrw-2020, the samples of Normal: DoHMalicious: NonDoH are 1980: 26964: 24983: 89749. Among them, Normal accounts for a relatively low proportion in all samples, so RS-KNN (RF), Anneal-KNN (RF), TPE-KNN (RF), GMGWO and NSGAIII cannot effectively detect Normal, but CNSGA achieves effective detection of all samples (detection accuracy> 70%). Fig.14As shown in the figure, since the samples of NSL_KDD are relatively balanced, all methods have good detection accuracy, but the method of this embodiment (CNSGA) is still one of the best. In UNSWNB15, the ratios of different samples Analysis: Backdoor: DoS: Exploits: Fuzzers: Generic: Normal: Reconnaissance: Shellcode: Worms are 397:319:2458:6724:3572:8195:11268:2177:219:30. Among them, the proportions of the five categories of samples, Analysis, Backdoor, Reconnaissance, Shellcode, and Worms, are all lower than 1% of the overall, far lower than the average. Therefore, the detection rates of the detection methods other than CNSGA and ADDC in such unbalanced samples are close to 0. However, the method of this embodiment (CNSGA) maintains a high detection rate in Analysis, Reconnaissance, and Shellcode, and its overall accuracy is also better than ADDC. It can be seen that in multi-classification, NSGA can effectively extract useful causal feature information through the guidance of causal weights, and the difference in causal feature information between samples of different categories is much greater than the difference between false associations or noise in the association relationship, so it can effectively distinguish rare samples and achieve a higher detection rate. Figure 12-14 As shown, in general, compared with the existing methods, the method of this embodiment (CNSGA) detects at least 1.5 more rare attack samples on average (detection rate>60%, that is, effective detection).
[0076] It can be seen that, whether in binary or multi-classification, genetic algorithms can effectively enrich the population while avoiding premature maturity and jumping out of local optimality. At the same time, under the guidance of causal weights, they can effectively learn causal feature information with large differences to improve the detection ability of attack types with fewer instances. Other algorithms, based on methods such as association reasoning, cannot distinguish between false associations and causal associations, resulting in the information of samples with fewer real classes being blurred in the noise information similar to that in the majority class samples, which easily causes overfitting of types with a higher proportion of instances and leads to imbalanced detection performance.
[0077] b) Analysis of imbalance index and optimal characteristic index values.
[0078] like Figure 14 to Figure 16 As shown, in order to more intuitively show the performance of each method in detecting balance and eliminating redundant information, combined with the calculation function expression recorded in this embodiment, this experiment compares and analyzes the balance index value and the optimal feature index value after the feature dimensions selected by each method in binary classification and multi-class classification detection. Figure 14 to Figure 16 As shown in Figure 2, the feature dimension selected by the method in this embodiment (CNSGA) and ADDC in binary classification is 3, which is the lowest among all methods, and the feature dimension of CNSGA is and The values are all the highest, indicating that the method in this embodiment (CNSGA) can effectively delete redundant information and improve detection efficiency and accuracy in the binary classification of CICDDOS2019 and DoHBrw-2020. In CICDDOS2019, the feature dimensions selected by NSGAIII and GMGWO in multi-classification are both as low as 10. In DoHBrw-2020 and NSL_KDD, the feature dimensions selected by GMGWO in multi-classification are both as low as 8. They are significantly smaller than the feature dimensions selected by other methods, but their The value is significantly lower than that of the method in this embodiment (CNSGA). Therefore, although the feature dimension selected by the method in this embodiment (CNSGA) is not the lowest, it is also significantly lower than that of most methods, and its and All represent the optimal values among all methods. It can be seen that some methods based on association reasoning cannot eliminate the interference of noise information. Although they select a shorter feature length, they may delete some causal features and retain the noise information, resulting in unbalanced detection and inability to solve the imbalance, such as GMGWO. The method of this embodiment (CNSGA) can effectively eliminate the interference of noise or redundant information on the detection method, guide the evolution of the genetic algorithm through causal weights to achieve the optimal population, so that the detection performance of the detection method achieves the optimal balance. Although the feature dimension selected is larger than that of NSGAIII and GMGWO on some data sets, it is obviously stronger in overall accuracy, balance and optimal feature subset. These results show that regardless of the size of the data set, the method of this embodiment (CNSGA) is optimally balanced and stable during detection, and has good generalization.
[0079] In summary, with the increasing use of devices and the increasing complexity of network environments, as well as the emergence of more and more encrypted traffic, we are faced with the problem of increasing difficulty in collecting and labeling some types of traffic. At the same time, this also causes the information we collect to become high-dimensional and redundant. Among them, the imbalance of training samples caused by the increased difficulty in collection and labeling makes it impossible to effectively detect these types of traffic. The massive high-dimensional redundant information not only brings false associations but also affects the computational efficiency and generalization of the detection system. These problems have led to great security challenges in the existing network environment. In order to cope with these difficulties, and inspired by causal reasoning and NSGAIII algorithms, the method of this embodiment (CNSGA) first generates an initial parent population according to the feature dimension; secondly, the Fourier feature transform is used to remove the false associations between the features, and then the causal effect weights between the features and the labels are calculated based on causal reasoning; then the detection balance index, the optimal feature subset index, and the causal effect weight are defined as fitness indicators for iterative optimization; finally, individuals are selected based on the non-dominated sorting of the reference point to form a new population. In order to vividly reflect the performance of each detection method in terms of balance and redundancy, this embodiment proposes to quantitatively analyze by defining the balance index and the optimal feature subset index. After comparative analysis, although some previous detection methods performed well on some common indicators, they performed poorly on the two indexes. In fact, they do have problems of detection imbalance and incomplete feature optimization. For example, although Anneal (see reference: J. Li, K.Cheng, S. Wang, F. Morstatter, RP Trevino, J. Tang, andH. Liu, "Feature selection: A data perspective," ACM Computing Surveys (CSUR) yol. 50. no. 6.p 94. 2018.) has a good overall accuracy on the CICDDoS2019 dataset (close to 90% accuracy), it performs poorly on the two indexes. For example, there are 5 types of attacks that cannot be effectively detected, that is, there is a serious detection imbalance problem. The optimal feature subset also includes some redundant features (such as the feature service), but deletes some features that should be retained (such as the feature is_host_login), which reduces the detection rate and accuracy of the system and affects the causal interpretability of the detection results. In order to solve the detection balance index and optimal feature subset index problems while ensuring the overall detection accuracy and causal interpretability of the detection results, inspired by causal reasoning and genetic algorithms (a random global search optimization method that originated from computer simulation research on biological systems), this embodiment provides a network anomaly detection causal genetic algorithm (CNSGA) for data imbalance and information redundancy.CNSGA not only moves towards a more adaptable environment like the biological evolution process in nature, but also effectively eliminates the interference of redundant and noisy information under the guidance of causal correlation weight (CCW) to quickly iterate optimization and converge, just like biological evolution under human guidance, and can quickly iterate the optimal population that meets human expectations. Therefore, the method of this embodiment (CNSGA) can quickly find the feature subset of the optimal solution, while taking into account 3 or more goals, especially after increasing the penalty for rare attack type detection (that is, the lower the rare attack detection rate, the lower the balance index score), the balance of the attack detection system can be better improved. In order to verify the effectiveness of the method (CNSGA) of this embodiment, large-scale experiments were conducted on three real data sets (Zeng, Zengri, Wei Peng, and Baokang Zhao. "Improving the accuracy of network intrusion detection with causal machinelearning." Security and Communication Networks 2021 (2021): 1-18.). The scores on the two indexes show that the method (CNSGA) of this embodiment is more robust, and has better performance than the existing optimal algorithm in terms of detection balance, optimal feature subset and overall detection accuracy. The method of this embodiment innovatively proposes the detection balance index and the optimal feature subset index as evaluation indicators of the attack detection method, providing an intuitive quantitative comparison for the detection balance and feature subset optimization problems. The method of this embodiment guides the evolution of the method (CNSGA) of this embodiment by the causal correlation weight (CCW), which effectively speeds up the speed of population optimization, reduces the number of iterations, and improves the performance of various indicators. The method of this embodiment verifies the robustness of our algorithm on four broadly representative data sets collected at different times and representing real-world attack standards. Experimental results on four datasets that can reflect the real-world network attack situation show that the method of this embodiment (CNSGA) can improve the overall accuracy of multi-class classification by up to >10% compared with the latest detection method; the imbalance index can be improved by up to >0.5, and 1.5 more attack types can be detected on average; the optimal index of feature subsets can be improved by up to >50%. Theoretical analysis and experimental results show that the method of this embodiment (CNSGA) can not only remove redundant information to improve the detection rate, but also improve the balance of the attack detection system, and has good stability and generalization performance.
[0080] In addition, this embodiment also provides a network abnormal traffic feature screening system based on a causal genetic algorithm, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the network abnormal traffic feature screening method based on a causal genetic algorithm.
[0081] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program / instruction is stored. The computer program / instruction is programmed or configured to execute the network abnormal traffic feature screening method based on the causal genetic algorithm through a processor.
[0082] In addition, this embodiment also provides a computer program product, including a computer program / instruction, which is programmed or configured to execute the network abnormal traffic feature screening method based on the causal genetic algorithm through a processor.
[0083] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. 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 produce 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 process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0084] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for screening network abnormal traffic characteristics based on causal genetic algorithm, characterized in that: include: S101, a parent population P consisting of M individuals is initialized and generated according to the traffic characteristics to be screened, where the individual is a chromosome formed by the characteristic coding, and the evolution iteration number Gen is 1; S102, randomly select N individuals from the parent population P to form the offspring population S; S103, merging the parent population P and the offspring population S to generate a population Q containing M+N individuals; S104, first determine that all individuals in the population Q have been sorted. If they have not been sorted, first calculate the fitness of all individuals in the population Q, including: find the causal association weight W between the feature and the result label according to causal reasoning, decode the parent population P, select features for training and detection to find the detection balance index and the optimal feature index, and finally use the detection balance index, the optimal feature index and the causal association weight W together as a multi-dimensional fitness index; then constrain and dominate all individuals based on the fitness of the individual and the associated reference point; S105, selecting N individuals from the sorted population Q to form a new parent population P; S106, determining that the evolution iteration number Gen is less than a preset threshold Gen max Is it true? If so, increase the evolution iteration number Gen by 1 and jump to step S102; otherwise, use the finally selected individual as the optimal traffic feature for network anomaly detection, and end and exit.
2. According to claim 1, the method for screening network abnormal traffic characteristics based on causal genetic algorithm is characterized in that: Before step S101, the process also includes removing false correlations between flow characteristics by converting characteristic values of flow characteristics through Fourier transform, and the calculation function expression of the characteristic values of flow characteristics through Fourier transform is as follows: , In the above formula, The space of functions representing random Fourier features, ∈ , is the characteristic value of the flow characteristic, is the Fourier transform eigenvalue, and is a random number, a random number Sampling from a standard normal distribution, is 0,1 distribution, uniform is the probability distribution function, express from The independence test statistic between all two traffic features A and B is calculated according to the following formula: : , In the above formula, Express request The norm of represents the partial cross-covariance matrix, and The Fourier transform transformed eigenvalues of the two eigenvalues A and B are represented respectively; If the independence test statistic between traffic features A and B is If the value of is equal to 0, the two traffic features A and B are determined to be independent, otherwise the traffic features A and B are determined to be not independent, and finally the traffic features that are not independent of other traffic features are removed.
3. According to claim 1, the method for screening network abnormal traffic characteristics based on causal genetic algorithm is characterized in that: In step S104, the causal association weight W between the feature and the result label is obtained according to causal reasoning: , In the above formula, is the number of features, Indicates that except After the first feature is set to normal, the values of other features remain unchanged and except for the The value of each feature remains unchanged, and the remaining features are intervened and set to normal. Indicates that except The expected value of the result label after the feature is intervened and set to normal, and the values of other features remain unchanged, Indicates that except The value of each feature remains unchanged, and the remaining features are set to normal. Represents a diagonal matrix , ~ are the causal association weights of the 1st to pth features, respectively. Indicates The serial number of the feature; Indicates that except Except for one feature that was set to normal by intervention, the values of other features remained unchanged; Indicates that except Except for the value of one feature that remains unchanged, the other features are set to normal.
4. According to claim 1, the method for screening network abnormal traffic characteristics based on causal genetic algorithm is characterized in that: When selecting features for training and detection in step S104 to obtain a detection balance index and an optimal feature index, the calculation function expression of the detection balance index is: , In the above formula, To detect the balance index, The closer it is to 0, the more serious the detection imbalance problem is. is the type of anomaly to be detected, For the The detection F1 score expected to be achieved by class samples, For the The actual detection F1 score of the class sample; the calculation function expression of the optimal feature index is: , In the above formula, is the optimal characteristic index, The closer it is to 0, the worse the ability of the intrusion detection system to screen causal features is, and vice versa; is the overall F1 score of the detection system, Representation characteristics The characteristic dimension, feature represents the causal feature set, Features The feature dimensions after filtering, Features The feature dimensions after filtering, Representation characteristics The characteristic dimension, feature represents the noise feature set.
5. According to claim 1, the method for screening network abnormal traffic characteristics based on causal genetic algorithm is characterized in that: In step S104, constrained ordering of all individuals based on the fitness of the individuals and the associated reference points refers to constrained ordering of all individuals using the NSGAIII algorithm based on the fitness of the individuals and the associated reference points.
6. The method for screening network abnormal traffic characteristics based on causal genetic algorithm according to claim 5 is characterized in that: The determination of the associated reference point includes: S201, based on the dimension μ of the fitness and the number h of reference points in each dimension, define reference points that are equally inclined for all target axes on the normalized hyperplane of the fitness, and the number of reference points is: , In the above formula, represents the number of reference points, Indicates from Select The value of the combination of targets, It refers to the uniformity of the distribution of reference points in each target dimension. These reference points are used to guide the search direction of the algorithm. m is the number of targets included in the fitness. S202, connecting each reference point with the origin to form a reference line; S203, first calculate each individual according to the following formula Horizontal and vertical distances to each reference line: , , In the above formula, Represents an individual To Reference lines The horizontal distance is the performance indicator, For reference line The coordinate vector of For performance indicators With reference line The inner product of Represents an individual To Reference lines The vertical distance of each individual The vertical distance to each reference line is used to find the distance from the individual The nearest reference point as an individual Key reference points.
7. The method for screening network abnormal traffic characteristics based on causal genetic algorithm according to claim 1 is characterized in that: In step S105, selecting N individuals from the sorted population Q to form a new parent population P includes: S301, for the sorted population Q, select individuals from the top-ranked regions according to the constraint dominance relationship and put them into the new parent population P, until the number of individuals in the new parent population P reaches ; S302, remember The number of individuals in the new parent population P is The last non-dominated layer of is the previous non-dominated layer, and the number of individuals in all non-dominated layers is , the first non-dominated layer The number of individuals is , if , then stop the selection, and the new parent population P satisfies , otherwise from the last non-dominated layer Region Selection individuals, so that the number of individuals in the new parent population P is equal to indivual.
8. A network abnormal traffic feature screening system based on causal genetic algorithm, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the network abnormal traffic feature screening method based on causal genetic algorithm as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instruction stored therein, characterized in that: The computer program / instruction is programmed or configured to execute the network abnormal traffic feature screening method based on causal genetic algorithm as described in any one of claims 1 to 7 through a processor.
10. A computer program product comprising a computer program / instructions, characterized in that The computer program / instruction is programmed or configured to execute the network abnormal traffic feature screening method based on causal genetic algorithm as described in any one of claims 1 to 7 through a processor.
Citation Information
Cited By
Feature selection method based on multi-target genetic algorithm
CN119577517A
Internet of Things attack detection method and system based on deep learning
CN119628959A
Evolutionary thought caching for multi-stage language model systems
US12585882B1
Persistent cognitive machine with curated long term memory
US12602549B1
Geometric Multi-Modal Sensor Fusion for Infrastructure Monitoring
US20260228438A1
