Multi-generator adversarial network intrusion detection method based on imaging variational enhancement
By using image-based variational enhancement of multi-generator adversarial networks, the problems of data imbalance and insufficient quality of generated samples in deep learning models in network intrusion detection are solved, achieving higher detection accuracy and robustness, and adapting to diverse attack patterns.
Patent Information
- Application Number
- CN202511449541.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-03-17
AI Technical Summary
Existing deep learning models face the problem of data imbalance in network intrusion detection, which leads to decreased detection performance and limited generalization ability. Traditional GAN models generate samples that are disconnected from the features of real samples and cannot effectively cover diverse attack patterns.
A graphical variational augmented multi-generator adversarial network is adopted. By combining multiple generators working in parallel and a graphical variational augmentation model with a variational autoencoder (VAE) and cosine similarity constraints, the quality and consistency of generated samples are optimized, thereby enhancing the robustness and accuracy of the detection model.
It significantly improves the authenticity and diversity of generated samples, expands the identification range of network intrusion detection systems, enhances the detection accuracy and robustness of models, strengthens the ability to distinguish between multiple attack types, and solves the problems of data imbalance and insufficient generalization ability.
Smart Images

Figure CN121690621A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for detecting network intrusion based on image-based variational enhancement multi-generators in the field of network security technology. Background Technology
[0002] With the increasing sophistication and diversification of cyberattack methods, cybersecurity has become a significant global challenge. The threat of cyberattacks is particularly acute in areas such as enterprise data security, personal privacy protection, and social stability. Deep learning (DL) methods, especially convolutional neural networks (CNNs), have gradually become the mainstream technology in the field of network intrusion detection (NID) due to their superior performance in processing large amounts of complex data. CNNs can effectively extract spatiotemporal features from traffic data and use them for attack detection, thereby improving cybersecurity capabilities.
[0003] However, malicious attack data in real-world network environments constitutes only a tiny fraction of total traffic, leading to severe data imbalance. In this situation, deep learning models often fail to fully learn attack patterns, resulting in decreased detection performance and limited generalization ability. Therefore, how to handle imbalanced data and improve the robustness and accuracy of deep learning models has become a crucial issue in current network intrusion detection research.
[0004] Traditional Generative Adversarial Networks (GANs) have made some progress in generating minority class samples, alleviating the data imbalance problem by generating new attack samples. However, standard GAN models typically generate data using random noise, which leads to a disconnect between the features of generated samples and real attack samples, and a single generator cannot effectively cope with diverse attack patterns. Summary of the Invention
[0005] The purpose of this invention is to provide a method for intrusion detection of adversarial networks based on image-based variational enhancement multi-generators, in order to solve the problems of insufficient data generation quality and insufficient coverage of single generator patterns in traditional GANs during intrusion detection.
[0006] To achieve the above objectives, this invention provides a method for detecting adversarial network intrusions based on image-based variational enhancement multi-generators, comprising the following steps:
[0007] Step 1, data preprocessing and image encoding, converts network traffic data into a two-dimensional image format, preserving the spatiotemporal and protocol features of the data for subsequent model training;
[0008] Step 2: Construction of the multi-generator adversarial network. Multiple generators work in parallel, with each generator responsible for generating attack samples of the required category. Through the adversarial training process, the model parameters of the generator and discriminator are optimized so that the distribution of generated attack samples approximates the distribution of real attack samples.
[0009] Step 3: Design an image-based variational enhancement model. Combine the variational autoencoder (VAE) to model the latent vectors of the generated samples, enhance the fidelity of the generated samples, and ensure the authenticity of the generated attack samples in the feature space.
[0010] Step 4, cosine similarity constraint: introduce cosine similarity metric into the generator loss function to optimize the similarity between generated samples and real samples, and enhance the intra-class consistency and inter-class separability of generated samples.
[0011] Step 5: Training and testing the network intrusion detection model. Combine the generated attack samples with actual network traffic data to train the intrusion detection model, and use the test set to verify it, obtaining the relevant performance indicators of the model, including precision, recall and F1 score.
[0012] Step 6, Model Evaluation and Optimization: Through comparative experiments with traditional models, the performance of the proposed method is evaluated, and the model is optimized to improve the detection accuracy and robustness of the intrusion detection system.
[0013] As a further improvement to the present invention, the specific content of step 1 is as follows.
[0014] Step 1.1: Select a network traffic dataset as the data source. By extracting traffic features, construct the dataset, including the source IP address, destination IP address, protocol type, and packet size of the network traffic.
[0015] Step 1.2: Preprocess the traffic data by using the t-SNE algorithm for dimensionality reduction, transforming the traffic data into a two-dimensional image that retains the spatial features and time-series information of the traffic data. The t-SNE algorithm formula is:
[0016]
[0017] in This is a traffic data matrix, where M represents the number of samples and N represents the original feature dimension. This is the result after dimensionality reduction from two dimensions.
[0018] Step 1.3: Standardize the converted image to ensure that the pixel values of the image data meet the input requirements of the training model and ensure the uniform scale of the image data.
[0019] As a further improvement to the present invention, the specific content of step 2 is as follows.
[0020] Step 2.1: Construct a multi-generator architecture, where each generator is responsible for generating an attack sample of a specific category. Design dedicated generators for different types of attacks.
[0021] Step 2.2 involves optimizing the parameters of the generator and discriminator through adversarial training. This ensures that the generated attack samples are similar to real attack samples in the feature space, thereby improving the model's generation ability and classification performance. The adversarial objective function for the generator and discriminator is:
[0022]
[0023] in This represents the k-th generator, used to generate attack samples of a specific category; It serves as a discriminator, used to distinguish between real traffic samples and generated samples; The number of generators corresponds to the number of attack categories. For the discriminator to judge real samples The discrimination score; For the discriminator to generate samples The discrimination score; It serves as a classifier, sharing the feature extraction part with the discriminator, and is used for classifying and discriminating multi-class attack samples; Based on real samples The classification loss function; Based on generated samples The classification loss function; This is a similarity constraint loss, used to maintain the similarity between generated samples and real samples in the feature space; These are the weighting coefficients for the similarity loss, used to adjust... Importance within the overall objective.
[0024] As a further improvement to the present invention, the specific content of step 3 is as follows.
[0025] Step 3.1: Construct a variational autoencoder (VAE), and learn the latent spatial representation of network traffic data through the VAE encoder to generate attack samples similar to real samples;
[0026] Step 3.2: Input the latent vectors generated by the encoder VAE into the generator to generate samples, ensuring that the distribution of the generated attack samples in the latent vector space is consistent with the distribution of the real attack samples.
[0027] Step 3.3: The generator is optimized by combining the reconstruction loss and adversarial loss of the encoder VAE to improve the quality of generated samples and enhance the stability of the model; the loss function of the encoder VAE is:
[0028]
[0029] in, It is a sample of real network traffic input. To reconstruct the sample, and These are the mean and standard deviation of the potential space, respectively. The Kullback-Leibler divergence is used to measure the difference between the latent spatial distribution and the standard normal distribution. is a weighting coefficient used to balance the proportions of the reconstruction error term and the KL divergence term in the overall loss.
[0030] As a further improvement to the present invention, the specific content of step 4 is as follows.
[0031] Step 4.1: During training, cosine similarity constraints are applied to the generator's output samples to ensure high similarity within the feature space, while also enhancing class separation and preventing pattern collapse. The formula for the intra-class similarity between generated samples and real samples is:
[0032]
[0033] in This is a feature extraction mapping function used to map input samples to a feature space; For vectors The inner product, the final Used to measure the The intra-class cosine similarity between generated samples and real samples; the larger the value, the closer the generated sample is to the real sample.
[0034] The formula for inter-class dissimilarity is:
[0035]
[0036] in For vectors The Euclidean norm, the final For the The average inter-class difference between real samples of one class and real samples of other classes; the smaller the value, the stronger the class discrimination.
[0037] Based on this, the composite similarity loss function of the generator is defined as:
[0038]
[0039] Its representative is the The composite similarity loss of the class generator is used to maximize intra-class similarity and minimize inter-class similarity, thereby enhancing the separability of samples and generation stability;
[0040] Step 4.2: Build a classifier. Input the generated attack samples and actual network traffic data into the classifier for training. The classifier determines whether the input data belongs to attack traffic based on its features and calculates relevant performance indicators.
[0041] Step 4.3: The performance metrics obtained through model training include precision, recall, and F1 score. Precision measures the accuracy with which the model identifies actual attack categories among samples deemed as attacks; recall measures the model's ability to cover actual attack samples; and the F1 score is the harmonic mean of precision and recall. The specific formula is as follows:
[0042]
[0043] Where TP represents true positive, FP represents false positive, FN represents false negative, Precision represents precision, Recall represents recall, and F1-score represents the F1 score.
[0044] As a further improvement to the present invention, the specific content of step 5 is as follows.
[0045] Step 5.1 Through cross-validation and experimental comparison, the IVAM-GAN model is compared with traditional deep learning models and generative adversarial network models to verify the detection performance and advantages of the proposed method.
[0046] Step 5.2: Evaluate the application effect of the generated attack samples in the detection model to ensure that the generated samples can effectively improve the accuracy and robustness of the intrusion detection model and further optimize the classification ability of the detection model.
[0047] Compared with the prior art, the beneficial effects of the present invention are as follows: 1) In terms of data processing and feature extraction, the present invention effectively improves the availability and quality of data through innovative data preprocessing and feature extraction methods, laying a solid foundation for subsequent model training and solving the problems of data sparsity and information loss that may occur in the data processing process of traditional methods.
[0048] 2) In terms of model architecture and generation capability, a multi-generator adversarial network structure is adopted. By having multiple generators work in parallel, this invention significantly improves the ability and diversity of the model to generate attack samples, effectively expands the identification range of the network intrusion detection system, and overcomes the problem that traditional methods cannot effectively cover multiple attack types.
[0049] 3) In terms of sample generation and optimization, this invention combines an image-based variational enhancement model with latent vector modeling and optimization to improve the realism and accuracy of generated samples, enhance the stability of the sample generation process, and solve the defects of low sample quality and insufficient generalization ability of traditional methods.
[0050] 4) Regarding the constraint and optimization mechanism, this invention optimizes the quality and consistency of generated samples by introducing cosine similarity constraints. While ensuring the authenticity of generated samples, it enhances the model's ability to distinguish between different types of attacks, thereby improving the overall accuracy and reliability of the intrusion detection system.
[0051] 5) In terms of performance evaluation and verification, this invention comprehensively evaluates the model by introducing comprehensive performance indicators such as precision, recall, and F1 score, ensuring the performance of the intrusion detection system and solving the problems of evaluation bias and insufficient verification that may exist in traditional methods.
[0052] 6) In terms of system robustness and adaptability, this invention improves the model's ability to detect known attacks and enhances its adaptability to new attack modes through multi-dimensional evaluation and optimization, ensuring the stability and robustness of the system in various complex environments and solving the problem that traditional systems are prone to failure when facing unknown attacks. Attached Figure Description
[0053] Figure 1 This is the overall flowchart of the present invention.
[0054] Figure 2 This is a flowchart of the image encoding process of the present invention.
[0055] Figure 3 This is a diagram illustrating the VAE model architecture implementation of the present invention.
[0056] Figure 4 This is a diagram illustrating the implementation of the IVAM-GAN model architecture of this invention.
[0057] Figure 5 This is the binary classification result of CICIDS-2017 of this invention.
[0058] Figure 6 This is the binary classification result of UNSW-NB15 of the present invention.
[0059] Figure 7 This is the binary classification result of CICIDS-2017 of this invention.
[0060] Figure 8 This is the binary classification result of UNSW-NB15 of the present invention. Detailed Implementation
[0061] The present invention will be further described below with reference to the accompanying drawings:
[0062] like Figure 1-4 The illustrated method for image-based variational enhancement multi-generator adversarial network intrusion detection includes the following steps:
[0063] Step 1, data preprocessing and image encoding, converts network traffic data into a two-dimensional image format, preserving the spatiotemporal and protocol features of the data for subsequent model training.
[0064] Step 1.1: Select a network traffic dataset as the data source. By extracting traffic features, construct the dataset, including the source IP address, destination IP address, protocol type, and packet size of the network traffic.
[0065] Step 1.2: Preprocess the traffic data by using the t-SNE algorithm for dimensionality reduction, transforming the traffic data into a two-dimensional image that retains the spatial features and time-series information of the traffic data. The t-SNE algorithm formula is:
[0066]
[0067] in This is a traffic data matrix, where M represents the number of samples and N represents the original feature dimension. This is the result after dimensionality reduction from two dimensions.
[0068] Step 1.3: Standardize the converted image to ensure that the pixel values of the image data meet the input requirements of the training model and ensure the uniform scale of the image data.
[0069] Step 2: Construction of the multi-generator adversarial network. Multiple generators work in parallel, with each generator responsible for generating attack samples of the required category. Through the adversarial training process, the model parameters of the generator and discriminator are optimized so that the distribution of generated attack samples approximates the distribution of real attack samples.
[0070] Step 2.1: Construct a multi-generator architecture, where each generator is responsible for generating an attack sample of a specific category. Design dedicated generators for different types of attacks.
[0071] Step 2.2 involves optimizing the parameters of the generator and discriminator through adversarial training. This ensures that the generated attack samples are similar to real attack samples in the feature space, thereby improving the model's generation ability and classification performance. The adversarial objective function for the generator and discriminator is:
[0072]
[0073] in This represents the k-th generator, used to generate attack samples of a specific category; It serves as a discriminator, used to distinguish between real traffic samples and generated samples; The number of generators corresponds to the number of attack categories. For the discriminator to judge real samples The discrimination score; For the discriminator to generate samples The discrimination score; It serves as a classifier, sharing the feature extraction part with the discriminator, and is used for classifying and discriminating multi-class attack samples; Based on real samples The classification loss function; Based on generated samples The classification loss function; This is a similarity constraint loss, used to maintain the similarity between generated samples and real samples in the feature space; These are the weighting coefficients for the similarity loss, used to adjust... Importance within the overall objective.
[0074] Step 3: Design an image-based variational enhancement model. Combine the variational autoencoder (VAE) to model the latent vectors of the generated samples, enhance the fidelity of the generated samples, and ensure the authenticity of the generated attack samples in the feature space.
[0075] Step 3.1: Construct a variational autoencoder (VAE), and learn the latent spatial representation of network traffic data through the VAE encoder to generate attack samples similar to real samples;
[0076] Step 3.2: Input the latent vectors generated by the encoder VAE into the generator to generate samples, ensuring that the distribution of the generated attack samples in the latent vector space is consistent with the distribution of the real attack samples.
[0077] Step 3.3: The generator is optimized by combining the reconstruction loss and adversarial loss of the encoder VAE to improve the quality of generated samples and enhance the stability of the model; the loss function of the encoder VAE is:
[0078]
[0079] in, It is a sample of real network traffic input. To reconstruct the sample, and These are the mean and standard deviation of the potential space, respectively. The Kullback-Leibler divergence is used to measure the difference between the latent spatial distribution and the standard normal distribution. is a weighting coefficient used to balance the proportions of the reconstruction error term and the KL divergence term in the overall loss.
[0080] Step 4, cosine similarity constraint: introduce cosine similarity metric into the generator loss function to optimize the similarity between generated samples and real samples, and enhance the intra-class consistency and inter-class separability of generated samples.
[0081] Step 4.1: During training, cosine similarity constraints are applied to the generator's output samples to ensure high similarity within the feature space, while also enhancing class separation and preventing pattern collapse. The formula for the intra-class similarity between generated samples and real samples is:
[0082]
[0083] in This is a feature extraction mapping function used to map input samples to a feature space; For vectors The inner product, the final Used to measure the The intra-class cosine similarity between generated samples and real samples; the larger the value, the closer the generated sample is to the real sample.
[0084] The formula for inter-class dissimilarity is:
[0085]
[0086] in For vectors The Euclidean norm, the final For the The average inter-class difference between real samples of one class and real samples of other classes; the smaller the value, the stronger the class discrimination.
[0087] Based on this, the composite similarity loss function of the generator is defined as:
[0088]
[0089] Its representative is the The composite similarity loss of the class generator is used to maximize intra-class similarity and minimize inter-class similarity, thereby enhancing the separability of samples and generation stability;
[0090] Step 4.2: Build a classifier. Input the generated attack samples and actual network traffic data into the classifier for training. The classifier determines whether the input data belongs to attack traffic based on its features and calculates relevant performance indicators.
[0091] Step 4.3: The performance metrics obtained through model training include precision, recall, and F1 score. Precision measures the accuracy with which the model identifies actual attack categories among samples deemed as attacks; recall measures the model's ability to cover actual attack samples; and the F1 score is the harmonic mean of precision and recall. The specific formula is as follows:
[0092]
[0093] Where TP represents true positive, FP represents false positive, FN represents false negative, Precision represents precision, Recall represents recall, and F1-score represents the F1 score.
[0094] Step 5: Training and testing the network intrusion detection model. Combine the generated attack samples with actual network traffic data to train the intrusion detection model, and use the test set to verify it, obtaining the relevant performance indicators of the model, including precision, recall and F1 score.
[0095] Step 5.1 Through cross-validation and experimental comparison, the IVAM-GAN model is compared with traditional deep learning models and generative adversarial network models to verify the detection performance and advantages of the proposed method.
[0096] Step 5.2: Evaluate the application effect of the generated attack samples in the detection model to ensure that the generated samples can effectively improve the accuracy and robustness of the intrusion detection model and further optimize the classification ability of the detection model.
[0097] Step 6, Model Evaluation and Optimization: Through comparative experiments with traditional models, the performance of the proposed method is evaluated, and the model is optimized to improve the detection accuracy and robustness of the intrusion detection system.
[0098] To verify the effectiveness of the method of the present invention, this embodiment conducts experiments based on two publicly available network traffic datasets, CICIDS2017 and UNSW-NB15.
[0099] First, the raw network traffic data is preprocessed, including traffic feature extraction, data cleaning and normalization. Then, the t-SNE algorithm is used to reduce the high-dimensional traffic features to a two-dimensional image representation, thereby preserving the spatial features and time series information of the network traffic.
[0100] Secondly, the generated two-dimensional image samples are input into the IVAM-GAN model, where a variational autoencoder (VAE) is used for latent space modeling to improve sample fidelity, a multi-generator structure is used to generate attack samples of different categories, and the adversarial training process improves sample quality through game optimization between the generator and the discriminator. Simultaneously, a cosine similarity constraint is introduced to ensure the intra-class similarity and inter-class discriminability of the generated samples in the feature space, avoiding the pattern collapse problem.
[0101] During model training, an intrusion detection classifier is trained using both generated and real samples, and the model is fine-tuned through cross-validation. Finally, the model performance is evaluated on the test set, and metrics such as precision, recall, and F1 score are calculated.
[0102] The final experimental results are as follows:
[0103] like Figure 5 As shown, in the binary classification task of the CICIDS-2017 dataset, the traditional oversampling methods ADASYN and B-SMOTE show limited performance improvement and a small increase in accuracy compared to the baseline DNN model. The classic GAN variant SNGAN achieves further optimization, while enhanced methods such as TACGAN and WGAN demonstrate superior performance improvements. Notably, IVAM-GAN exhibits leading performance in both normal traffic and attack detection categories, achieving a mean precision of 0.9968, a recall of 0.9968, and an F1 score of 0.9967, respectively. Compared to the poorly performing WGAN model, these results represent improvements of 1.12%, 1.24%, and 1.17% across the three metrics, respectively.
[0104] like Figure 6 As shown, on the more complex UNSW-NB15 dataset, the traditional oversampling methods ADASYN and B-SMOTE no longer show a significant advantage, performing comparably to the baseline DNN classifiers. The three GAN variants—SNGAN, TACGAN, and WGAN—achieved similar performance levels in terms of accuracy. Notably, the IVAM-GAN model maintained its technical advantage in this challenging scenario, improving precision, recall, and F1 score by 1.4%, 0.8%, and 1.38%, respectively, compared to the poorly performing WGAN model.
[0105] like Figure 7 As shown, the IVAM-GAN model demonstrated significant advantages across all seven categories of the CICIDS-2017 multi-class classification task. In the crucial category 0, it achieved the highest performance metrics with a precision of 0.9992, a recall of 0.9976, and an F1 score of 0.9983, representing a 2.48% improvement over the TACGAN baseline of 0.9735 (precision = 0.9754, recall = 0.9723). In the challenging category 4 (class imbalance), IVAM-GAN delivered superior results with an F1 score of 0.9915 (precision = 0.9835, recall = 0.9985), a significant 355% improvement over ADASYN's F1 score of 0.2789.
[0106] like Figure 8As shown, IVAM-GAN maintains its technical advantage in the fine-grained five-class classification task of UNSW-NB15. For Class 2, which features diverse attack types, the model achieves a precision of 0.7762 (a 1.39% improvement over TACGAN's 0.7623) and an F1 score of 0.7849 (a 0.72% improvement over WGAN's 0.7777), demonstrating accurate detection capabilities. Particularly in Class 1 (low-frequency attacks), IVAM-GAN significantly outperforms ADASYN, achieving a precision of 0.8733 compared to ADASYN's 0.6374, while maintaining the highest recall of 0.9461. These results highlight IVAM-GAN's enhanced capabilities in complex detection environments.
[0107] This invention significantly improves the robustness and generalization ability of network intrusion detection systems on imbalanced datasets by collaboratively optimizing the generated samples and classification models, providing an innovative solution for network security detection.
[0108] This invention is not limited to the above embodiments. Based on the technical solutions disclosed herein, those skilled in the art can make some substitutions and modifications to some of the technical features without creative effort, and all such substitutions and modifications are within the protection scope of this invention.
Claims
1. An image-based variational augmented multi-generator generative adversarial network intrusion detection method, characterized in that: The method comprises the following steps: Step 1, data preprocessing and image coding, converting network traffic data into a two-dimensional image format, preserving the space-time characteristics and protocol characteristics of the data for subsequent model training; Step 2, construction of a multi-generator adversarial network, multiple generators work in parallel, each generator is responsible for generating attack samples of a specific category, through adversarial training, the model parameters of the generator and the discriminator are optimized, so that the distribution of the generated attack samples approximates the distribution of the real attack samples; Step 3, design of the image-based variational enhancement model, combine the variational autoencoder VAE to model the latent vector of the generated samples, enhance the fidelity of the generated samples, and ensure the authenticity of the generated attack samples in the feature space; Step 4, cosine similarity constraint, introduce cosine similarity measurement in the generator loss function, optimize the similarity between the generated samples and the real samples, and enhance the intra-class consistency and inter-class separability of the generated samples; Step 5, network intrusion detection model training and testing, combine the generated attack samples with the actual network traffic data to train the intrusion detection model, and use the test set for verification to obtain the performance indicators of the model, including precision, recall and F1 value; Step 6, model evaluation and optimization, compare the performance of the proposed method with traditional models through comparative experiments, and optimize the model to improve the detection accuracy and robustness of the intrusion detection system. 2.The image-based variational autoencoder intrusion detection method of claim 1, wherein: The specific content of step 1 is as follows: Step 1.1, select a network traffic dataset as the data source, extract the traffic features to construct the dataset, including the source IP address, target IP address, protocol type, and packet size of the network traffic; Step 1.2, preprocess the traffic data, use t-SNE algorithm for dimension reduction, convert the traffic data into two-dimensional image, so that the image can preserve the spatial characteristics and time series information of the traffic data; the formula of t-SNE algorithm is: ; wherein is the flow data matrix, M represents the number of samples, N represents the original feature dimension, is the result of two-dimensional dimension reduction; Step 1.3, standardize the converted image, so that the pixel value of the image data meets the input requirements of the training model, and ensure the uniform scale of the image data. 3.The image-based variational autoencoder intrusion detection method of claim 2, wherein: The specific content of step 2 is as follows: Step 2.1, build a multi-generator architecture, each generator is responsible for generating attack samples of a specific category, and design a dedicated generator for different types of attacks; Step 2.2, optimize the parameters of the generator and the discriminator through adversarial training, so that the generated attack samples are similar to the real attack samples in the feature space, and improve the generation ability and classification performance of the model; the adversarial objective function of the generator and the discriminator is: ; wherein represents the kth generator for generating attack samples of a specific category; represents the discriminator for distinguishing real traffic samples from generated samples; represents the number of generators, corresponding to the number of attack categories; represents the discrimination score of the discriminator for real samples ; represents the discrimination score of the discriminator for generated samples ; represents the classifier, sharing the feature extraction part with the discriminator, for the classification and discrimination of multi-category attack samples; represents the classification loss function based on real samples ; represents the classification loss function based on generated samples ; represents the similarity constraint loss for maintaining the similarity of generated samples and real samples in the feature space; represents the weight coefficient of the similarity loss, for adjusting the importance of in the total target.
4. The image-based variational autoencoder multi-generator generative adversarial network intrusion detection method of claim 3, wherein: The specific content of step 3 is as follows: Step 3.1, build a variational autoencoder VAE, learn the latent space representation of network traffic data through the encoder VAE, and generate attack samples similar to real samples; Step 3.2, input the latent vector generated by the encoder VAE into the generator to generate samples, ensure that the distribution of the generated attack samples in the latent vector space is consistent with the distribution of the real attack samples; Step 3.3, optimize the generator through the reconstruction loss and adversarial loss of the encoder VAE, improve the quality of the generated samples, and enhance the stability of the model; the loss function of the encoder VAE is: ; wherein, is the input real network traffic sample, is the reconstructed sample, and are the mean and standard deviation of the latent space, respectively, is the Kullback-Leibler divergence used to measure the difference between the latent space distribution and the standard normal distribution, is the weight coefficient used to balance the proportion of the reconstruction error term and the KL divergence term in the overall loss.
5. The image-based variational autoencoder multi-generator generative adversarial network intrusion detection method of claim 4, wherein, The specific content of step 4 is as follows, Step 4.1, during the training process, the output samples of the generator are subjected to cosine similarity constraint to ensure that the generated samples maintain high similarity in the feature space, while enhancing the class separation degree of the generated samples and avoiding the problem of mode collapse; the formula for the similarity between the generated samples and the real samples within the same class is: ; in This is a feature extraction mapping function used to map input samples to a feature space; For vectors The inner product, the final Used to measure the The intra-class cosine similarity between generated samples and real samples; the larger the value, the closer the generated sample is to the real sample. The formula for the inter-class difference degree is: ; wherein is the Euclidean norm of the vector is the final is used for the average inter-class variance between the first class real samples and other class real samples, the smaller the value is, the stronger the class discrimination is. Based on this, the composite similarity loss function of the generator is defined as: ; It represents the first The composite similarity loss of the class generator is used to maximize the intra-class similarity and minimize the inter-class similarity, thereby enhancing the separability and stability of the generated samples. Step 4.2, construct a classifier, input the generated attack samples and actual network traffic data into the classifier for training, and the classifier determines whether the input data belongs to attack traffic according to its features, and calculates the relevant performance indicators; Step 4.3, the performance indicators obtained through model training include precision, recall and F1 value, among which, the precision is used to measure the accuracy of the model in judging the true attack category among the samples judged as attack, the recall is used to measure the coverage ability of the model in identifying the actual attack samples, and the F1 value is the harmonic mean of the precision and recall; the specific formula is: ; ; ; Where TP is true positive, FP is false positive, FN is false negative, Precision is precision, Recall is recall, and F1-score is F1 value.
6. The image-based variational autoencoder multi-generator generative adversarial network intrusion detection method of claim 5, wherein, The specific content of step 5 is as follows, Step 5.1, through cross-validation and experimental comparison, compare the IVAM-GAN model with traditional deep learning models and generative adversarial network models to verify the detection performance and advantages of the proposed method; Step 5.2, evaluate the application effect of the generated attack samples in the detection model to ensure that the generated samples can effectively improve the accuracy and robustness of the intrusion detection model and further optimize the classification ability of the detection model.
Citation Information
Cited By
A power system extreme weather scenario small sample generation and identification method based on a multi-generator-evaluator collaborative mechanism and a storage medium
CN122173937A
