Industrial internet traffic sample expansion method and system based on VAE-GAN
By combining VAE and GAN models in the industrial Internet traffic sample expansion, local and timing characteristics are extracted, and the parameters of VAE decoder are optimized through the evaluation and feedback of the GAN model, the problem of insufficient traffic sample quality in the prior art is solved, and more accurate and objective traffic sample generation is achieved.
Patent Information
- Application Number
- CN202510415264.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-03
AI Technical Summary
In the prior art, the traffic samples expanded by machine learning models cannot accurately and objectively reflect the real data of the industrial Internet. The samples generated by VAE are of poor quality, and the samples generated by GAN are lacking authenticity.
Using the industrial Internet traffic sample expansion method based on VAE-GAN, local features and timing features are extracted through the VAE encoder, context feature vectors are generated, and data evaluation and feedback are combined with the discriminator of the GAN model, and the parameters of the VAE decoder are optimized to generate more realistic traffic samples.
It realizes the generation of traffic samples that are more realistic and closer to real data, which can accurately and objectively reflect the real data of the industrial Internet, thereby improving the training effect of machine learning models and the accuracy of analyzing models.
Smart Images

Figure CN120223403A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic sample expansion, and particularly to an industrial Internet traffic sample expansion method and system based on VAE-GAN. Background Art
[0002] As a revolutionary technology, the Internet has currently achieved deep integration with different fields. As a product of the deep integration of traditional industries and Internet technologies, the industrial Internet has developed rapidly in recent years. As of now, the industrial Internet industry scale has reached 5.0 trillion yuan, which means the widespread application of a large number of industrial devices. The industrial Internet has the characteristics of openness, interconnectivity, and complexity. Any device connected to the network may become an entry point for attacks. The increase in devices also means an expansion of the scope of network attacks. This situation has led to severe security challenges for the industrial Internet.
[0003] In the prior art, methods such as encrypted traffic classification and abnormal traffic detection are generally used to improve the security of the industrial Internet. These methods rely on machine learning model training. Machine learning model training often requires a large amount of traffic data as a basis. High-quality traffic data is the key to improving the performance of machine learning models. However, in the industrial Internet, the acquisition cost of traffic data is high and the samples are insufficient, which results in poor training effects of machine learning models.
[0004] Most of the existing traffic data expansion methods use the VAE (Variational Auto-Encoders) model and the GAN (Generative Adversarial Network) model, but both have certain defects in data expansion: the traffic data samples generated by VAE may lack clear details and structures, resulting in inaccurate and non-specific expanded traffic samples. Therefore, the quality of the traffic samples generated by VAE is poor; although the GAN network model and its variants are popular traffic data expansion methods in most fields, the generator of the GAN network model will fall into generating the same or very similar traffic samples, which leads to a lack of authenticity in the generated traffic samples. Therefore, the expanded traffic samples generated by existing machine learning models cannot accurately and objectively reflect the real data of the industrial Internet. Summary of the Invention
[0005] The main objective of the present invention is to provide an industrial Internet traffic sample expansion method and system based on VAE-GAN, aiming to solve the technical problem that the traffic samples expanded by machine learning models in the prior art cannot accurately and objectively reflect the real data of the industrial Internet.
[0006] The present invention proposes an industrial Internet traffic sample expansion method based on VAE-GAN, including:
[0007] Obtain the original training data, and preprocess the original training data to obtain the original tensor data;
[0008] Input the original tensor data into the VAE encoder to extract the feature vectors corresponding to the original tensor data;
[0009] Multiple said local feature vectors and multiple said temporal feature vectors generate multiple context feature vectors through the first fully connected layer of the VAE encoder;
[0010] Multiple said context feature vectors generate latent variable data through the second fully connected layer of the VAE encoder;
[0011] Input the latent variable data into the VAE decoder for data expansion to obtain the reconstructed data;
[0012] Input the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result;
[0013] Judge whether the evaluation result meets the preset conditions;
[0014] If the evaluation result does not meet the preset conditions, the discriminator generates feedback information according to the evaluation result, the VAE decoder adjusts its own parameters according to the feedback information, regenerates the reconstructed data, and returns to the step of inputting the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result;
[0015] If the reconstructed data matches the original tensor data according to the preset conditions, output the reconstructed data and use the reconstructed data as the traffic sample.
[0016] Preferably, the step of obtaining the target training data and preprocessing the target training data to obtain the original tensor data includes:
[0017] Obtain the original data set, where the original data set includes industrial public data, simulated industrial scenario data, and real industrial scenario data;
[0018] Slice the original data set at the data stream level to obtain multiple streams, where each stream contains a fixed number of traffic packets;
[0019] Perform data cleaning on multiple traffic packets, and slice each cleaned traffic packet according to a preset byte length to obtain multiple data segments;
[0020] Scale multiple data segments in each traffic packet in proportion according to a preset ratio to obtain multiple multi-dimensional tensors corresponding to the multiple data segments, and integrate all the multi-dimensional tensors of multiple traffic packets to obtain original tensor data.
[0021] Preferably, the step of inputting the original tensor data into a VAE encoder to extract the feature vector corresponding to the original tensor data includes:
[0022] Input the original tensor data into the two convolutional layers of the VAE encoder to extract the local feature vector of the original tensor data;
[0023] Construct an LSTM layer in the VAE encoder;
[0024] Extract the temporal feature vector of the original tensor data based on the LSTM layer;
[0025] Take the local feature vector and the temporal feature vector as the feature vector corresponding to the original tensor data.
[0026] Preferably, the step of generating latent variable data by the second fully connected layer of the VAE encoder for the multiple context feature vectors includes:
[0027] Input the multiple context feature vectors into the second fully connected layer of the VAE encoder to map the multiple context feature vectors to the latent space, and calculate the mean, variance, and standard deviation corresponding to the multiple context feature vectors in the latent space;
[0028] Randomly sample according to the mean and variance corresponding to the multiple context feature vectors to generate multiple target feature vectors;
[0029] Obtain multiple random noises;
[0030] Randomly fuse the multiple random noises with the multiple target feature vectors to obtain multiple fused vectors;
[0031] The multiple fused vectors generate latent variable data based on the principle of the reparameterization trick.
[0032] Preferably, the step of inputting the latent variable data into the VAE decoder for data augmentation to obtain reconstructed data includes:
[0033] Input the latent variable data into the fully connected layer of the VAE decoder for augmentation to obtain an intermediate feature vector;
[0034] Input the intermediate feature vector into the bidirectional LSTM layer of the VAE decoder, and restore the length and number of channels of the intermediate feature vector based on the principle of the transposed convolutional layer;
[0035] Generate reconstructed data with the same shape as the original tensor data based on the length and number of channels of the intermediate feature vector.
[0036] Preferably, after the step of generating reconstructed data with the same shape as the original tensor data, it includes:
[0037] Calculate the mean square error between the reconstructed data and the original tensor data based on the reconstruction loss function;
[0038] Regularize the latent space of the latent variable data based on the KL divergence to obtain the KL divergence value;
[0039] Generate the total loss value of the VAE decoder based on the mean square error and the KL divergence value;
[0040] Optimize the parameters of the VAE decoder based on the total loss value;
[0041] Input the latent variable data into the VAE decoder with optimized parameters for expansion to generate optimized data, and use the optimized data as the reconstructed data.
[0042] Preferably, the step of inputting the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result includes:
[0043] The reconstructed data and the original tensor data respectively pass through the convolutional layer and pooling layer of the GAN model discriminator to extract reconstructed features and original features;
[0044] Input the reconstructed features and the tensor features into the fully connected layer of the GAN model discriminator respectively to map the reconstructed features and the tensor features into reconstructed probability values and original probability values respectively;
[0045] Use the reconstructed probability value and the original probability value as the evaluation result.
[0046] Preferably, the step of the discriminator generating feedback information according to the evaluation result includes:
[0047] Fix the parameters of the VAE encoder and decoder;
[0048] Obtain the reconstructed probability value and the original probability value in the evaluation result;
[0049] Generate the discriminator loss value of the discriminator of the GAN model according to the original probability value and the reconstructed probability value;
[0050] Obtain the weighted average of the reconstructed data and the total loss value of the VAE decoder;
[0051] Construct a generator loss function of the GAN model based on the weighted mean, the reconstruction probability value, and the total loss value of the VAE decoder;
[0052] Construct a total loss function of the VAE-GAN fusion model based on the generator loss function of the GAN model and the total loss value of the VAE decoder;
[0053] The discriminator of the GAN model generates feedback information based on the total loss function.
[0054] The present invention also provides an industrial Internet traffic sample augmentation system based on VAE-GAN, including a plurality of modules, and the plurality of modules are used to implement the steps of any one of the above methods.
[0055] The present invention also provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the above-mentioned industrial Internet traffic sample augmentation method based on VAE-GAN.
[0056] The beneficial effects of the present invention are as follows: The present invention first obtains the original training data, preprocesses it to obtain multi-dimensional original tensor data, then extracts local feature vectors and temporal feature vectors according to the VAE encoder, and generates corresponding context feature vectors. Generate latent variable data based on the context feature vectors, put the latent variable data into the VAE decoder for data augmentation to obtain reconstructed data; input the reconstructed data into the discriminator of the GAN model, and the discriminator of the GAN model can evaluate the reconstructed data generated by the VAE model decoder, judge whether it is close to the real traffic data, and generate feedback information. The VAE decoder adjusts its own parameters according to the feedback information and regenerates the reconstructed data. The discriminator of the GAN model judges the regenerated reconstructed data again until it is close to the real traffic data. In this way, by continuously optimizing the own parameters of the VAE decoder, it can generate more realistic and closer-to-real data traffic samples, so as to more accurately and objectively reflect the real data of the industrial Internet. More preferably, it can provide high-quality training data sets for traffic analysis technologies such as industrial Internet encrypted traffic classification and abnormal traffic detection, and improve the accuracy and generalization ability of the analysis model. Description of the Drawings
[0057] Figure 1 It is a schematic flowchart of the method according to an embodiment of the present invention.
[0058] The realization, functional characteristics and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the drawings. Detailed Embodiments
[0059] It should be understood that the specific embodiments described herein are merely used to explain the present invention and are not used to limit the present invention.
[0060] As Figure 1 shown, this application provides an industrial Internet traffic sample expansion method based on VAE-GAN, including:
[0061] S1. Obtain the original training data and preprocess the original training data to obtain the original tensor data;
[0062] S2. Input the original tensor data into the VAE encoder to extract the feature vectors corresponding to the original tensor data;
[0063] S3. Multiple said local feature vectors and multiple said temporal feature vectors generate multiple context feature vectors through the first fully connected layer of the VAE encoder;
[0064] S4. Multiple said context feature vectors generate latent variable data through the second fully connected layer of the VAE encoder;
[0065] S5. Input the latent variable data into the VAE decoder for data expansion to obtain the reconstructed data;
[0066] S6. Input the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result;
[0067] S7. Determine whether the evaluation result meets the preset conditions;
[0068] If the evaluation result does not meet the preset conditions, the discriminator generates feedback information according to the evaluation result, the VAE decoder adjusts its own parameters according to the feedback information, regenerates the reconstructed data, and returns to the step of inputting the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result;
[0069] If the reconstructed data matches the original tensor data according to the preset conditions, output the reconstructed data and use the reconstructed data as the traffic sample.
[0070] As described in the above steps S1 - S7, first, the original training data is obtained and pre - processed to obtain multi - dimensional original tensor data. Then, the local feature vectors are extracted according to the VAE encoder. Since the VAE encoders in the prior art often only extract local feature vectors, this also results in poor quality of the generated traffic samples. In order to obtain rich traffic features so that the subsequently generated traffic samples are closer to the real data, this application also extracts temporal feature vectors, and based on the VAE encoder, generates context feature vectors corresponding to the local feature vectors and temporal feature vectors, and maps the context feature vectors into the latent space to map the high - dimensional feature vectors into low - dimensional vectors to obtain latent variable data. The latent variable data is put into the VAE decoder for data augmentation, and the reconstructed data is obtained after the augmentation is completed.
[0071] The original VAE model includes an encoder and a decoder, and the GAN model includes a generator and a discriminator. Among them, the decoder of the VAE model and the generator of the GAN model are both used for traffic augmentation. In order to make the reconstructed data closer to the real industrial Internet data, and to avoid repeated generation of the reconstructed data and reduce the computing cost, this application combines the VAE model and the GAN model. The combination method is to extract the encoder, decoder of the VAE model and the discriminator of the GAN model. The encoder of the VAE model can encode the original tensor data into a distribution in the latent space, which provides a richer latent space representation for the discriminator of the GAN model. The VAE model is trained by maximizing the likelihood, which easily leads to blurred generated traffic samples. The discriminator in the GAN model can evaluate the quality of the generated traffic samples. The VAE - GAN model can take advantage of this, let the traffic samples generated by the VAE model (i.e., the reconstructed data in this application) be screened by the discriminator of the GAN model, so that it generates more realistic and closer - to - real - data traffic samples. In this way, the GAN model can also better learn the data distribution, thereby reducing the possibility of mode collapse. Combining the advantages of both improves the quality of traffic data generation.
[0072] Specifically, the reconstructed data is input into the discriminator of the GAN model. The discriminator of the GAN model can evaluate the reconstructed data generated by the decoder of the VAE model to determine whether it is close to the real traffic data, that is, whether it is close to the original training data. According to the evaluation results, the discriminator generates feedback information. The VAE decoder adjusts its own parameters according to the feedback information and regenerates the reconstructed data. The discriminator of the GAN model then judges the regenerated reconstructed data until it is close to the real traffic data. In this way, by continuously optimizing the parameters of the VAE decoder itself, it can generate more realistic and real-data-close traffic samples, so as to more accurately and objectively reflect the real data of the industrial Internet. More preferably, it can provide a high-quality training data set for traffic analysis technologies such as encrypted traffic classification and abnormal traffic detection in the industrial Internet, and improve the accuracy and generalization ability of the analysis model.
[0073] In one embodiment, the step S1 of obtaining the target training data and preprocessing the target training data to obtain the original tensor data includes:
[0074] S11. Obtain the original data set, where the original data set includes industrial public data, simulated industrial scenario data, and real industrial scenario data;
[0075] S12. Split the original data set at the data stream level to obtain multiple streams, where each stream contains a fixed number of traffic packets;
[0076] S13. Clean the data of multiple traffic packets, and slice each cleaned traffic packet according to a preset byte length to obtain multiple data segments;
[0077] S14. Scale the multiple data segments in each traffic packet proportionally according to a preset ratio to obtain multiple multi-dimensional tensors corresponding to the multiple data segments, and integrate all the multi-dimensional tensors of multiple traffic packets to obtain the original tensor data.
[0078] As described in the above steps S11 - S14, in order to generate data samples containing the characteristics of industrial Internet traffic, an original data set containing multiple industrial - specific protocols is constructed by integrating public data sets, simulated industrial scenarios, and real industrial scenarios during data collection. The original data set uses the PCAP file format. The original PCAP file is sliced at the data stream level. First, redundant traffic packets in the PCAP file are removed, traffic packets containing invalid IP addresses and port numbers are filtered, and traffic packets irrelevant to the transmission content of specific traffic (such as DNS / ARP / DHCP, etc.) are removed, obtaining multiple sliced traffic packets. Each traffic packet is sliced to obtain multiple data segments with a byte length of L (preset byte length). The multiple data segments are scaled proportionally so that they fall into a specific small interval, obtaining multiple multi - dimensional tensors. The multi - dimensional tensors of all traffic packets are summarized to obtain the original tensor data.
[0079] In one embodiment, step S2 of inputting the original tensor data into the VAE encoder to extract the feature vector corresponding to the original tensor data includes:
[0080] S21: Input the original tensor data into the two - layer convolutional layer of the VAE encoder to extract the local feature vector of the original tensor data;
[0081] S22: Construct an LSTM layer in the VAE encoder;
[0082] S23: Extract the temporal feature vector of the original tensor data based on the LSTM layer;
[0083] S24: Use the local feature vector and the temporal feature vector as the feature vector corresponding to the original tensor data.
[0084] As described in the above steps S21 - S24, the encoder of the VAE contains two - layer convolutional layers for extracting the local feature vector of the original tensor data, mapping the original tensor data from a high - dimensional space to a low - dimensional space. Since the existing VAE encoder can only extract local feature vectors, the quality of the traffic samples generated by its decoder is also poor. In order to extract richer traffic features, an LSTM layer is constructed in the VAE encoder, and the temporal feature vector of the original tensor data is extracted based on the LSTM layer.
[0085] In one embodiment, step S4 of generating the latent variable data by the second fully - connected layer of the VAE encoder for the multiple context feature vectors includes:
[0086] S41. Input the multiple context feature vectors into the second fully-connected layer of the VAE encoder to map the multiple context feature vectors to the latent space, and calculate the mean, variance, and standard deviation corresponding to the multiple context feature vectors in the latent space;
[0087] S42. Randomly sample based on the mean and variance corresponding to the multiple context feature vectors to generate multiple target feature vectors;
[0088] S43. The multiple target feature vectors generate latent variable data based on the principle of the reparameterization trick.
[0089] As described in the above steps S41 - S43, map the multiple context feature vectors to the latent space through two second fully-connected layers, and calculate the mean, variance, and standard deviation corresponding to the multiple context feature vectors in the latent space; through the reparameterization trick, these parameters can be combined with random noise to generate latent variable data.
[0090] In one embodiment, the step S5 of inputting the latent variable data into the VAE decoder for data augmentation to obtain reconstructed data includes:
[0091] S51. Input the latent variable data into the fully-connected layer of the VAE decoder for augmentation to obtain intermediate feature vectors;
[0092] S52. Input the intermediate feature vectors into the bidirectional LSTM layer of the VAE decoder, and restore the length and number of channels of the intermediate feature vectors based on the principle of the transposed convolutional layer;
[0093] S53. Based on the length and number of channels of the intermediate feature vectors, generate reconstructed data with the same shape as the original tensor data.
[0094] As described in the above steps S51 - S53, a fully-connected layer in the VAE decoder is used to expand the latent variable data into intermediate feature vectors for representation, then the expanded intermediate feature vectors are processed using a bidirectional LSTM layer, and the transposed convolutional layer is used to gradually restore the length and number of channels of the intermediate feature vectors, and finally generate reconstructed data with the same shape as the input data (original tensor data).
[0095] In one embodiment, after the step S53 of generating reconstructed data with the same shape as the original tensor data, it includes:
[0096] S54. Calculate the mean square error between the reconstructed data and the original tensor data based on the reconstruction loss function;
[0097] S55. Regularize the latent space of the latent variable data based on the KL divergence to obtain the KL divergence value;
[0098] S56. Generate the total loss value of the VAE decoder based on the mean square error and KL divergence value;
[0099] S57. Optimize the parameters of the VAE decoder based on the total loss value;
[0100] S58. Input the latent variable data into the VAE decoder with optimized parameters for expansion to generate optimized data, and use the optimized data as the reconstructed data.
[0101] As described in the above steps S54 - S58, in order to make the reconstructed data as close as possible to the original tensor data, the VAE model is optimized here by calculating the mean square error (MSE) between the reconstructed data and the original tensor data. Specifically, the parameters of the VAE model encoder and decoder are updated and optimized by minimizing the reconstruction loss and KL divergence. Among them, minimizing the reconstruction loss measures the similarity between the reconstructed data generated by the decoder and the original input data (original tensor data), and the reconstruction loss ensures that the decoder can restore the original input data as much as possible, thereby improving the reconstruction ability of the VAE model. Among them, the expression of the reconstruction loss function is:
[0102]
[0103] Among them, the Reconstruction Loss represents the mean square error of the reconstruction loss, N represents the batch size, x i represents the original tensor data of the i-th input, and the x recon,i represents the i-th reconstructed data generated by the decoder;
[0104] KL divergence is used to regularize the latent space so that the distribution of the latent variable data is close to the standard normal distribution N(0, 1). KL divergence regularizes the latent space, making the distribution of the latent variable data smoother and facilitating the generation of new samples. The calculation formula of KL divergence is:
[0105]
[0106] Among them, the KL Divergence represents the KL divergence value, N represents the batch size, represents the mean of the latent variable data, represents the standard deviation of the latent variable data;
[0107] Generate the total loss value of the VAE decoder based on the mean square error and KL divergence value. Among them, the calculation formula of the total loss value is:
[0108] VAE Total Loss = Reconstruction Loss + β * KLDivergence;
[0109] Among them, the VAE Total Loss represents the total loss value, and β represents a hyperparameter used to balance the reconstruction loss and the KL divergence.
[0110] In one embodiment, the step S6 of inputting the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result includes:
[0111] S61. The reconstructed data and the original tensor data respectively pass through the convolutional layer and the pooling layer of the GAN model discriminator to extract reconstructed features and original features;
[0112] S62. The reconstructed features and the tensor features are respectively input into the fully connected layer of the GAN model discriminator to map the reconstructed features and the tensor features into reconstructed probability values and original probability values respectively;
[0113] S63. The reconstructed probability value and the original probability value are used as the evaluation result.
[0114] As described in the above steps S61 - S63, the discriminator of the GAN model is applied to distinguish whether the input data is real or fake data generated by the generator of the GAN model. The discriminator includes four convolutional layers and pooling layers for extracting reconstructed features and original features, and two fully connected layers for mapping the reconstructed features and the original features into reconstructed probability values and original probability values.
[0115] In one embodiment, the step S7 of the discriminator generating feedback information according to the evaluation result includes:
[0116] S71. Fix the parameters of the VAE encoder and decoder;
[0117] S72. Obtain the reconstructed probability value and the original probability value in the evaluation result;
[0118] S73. Generate the discriminator loss value of the GAN model according to the original probability value and the reconstructed probability value;
[0119] S74. Obtain the weighted average value of the reconstructed data and the total loss value of the VAE decoder;
[0120] S75. Construct the generator loss function of the GAN model based on the weighted mean value, the reconstructed probability value and the total loss value of the VAE decoder;
[0121] S76. Construct the total loss function of the VAE - GAN fusion model based on the generator loss function of the GAN model and the total loss value of the VAE decoder;
[0122] S77. The discriminator of the GAN model generates feedback information based on the total loss function.
[0123] As described in the above steps S71 - S77, during the training process, the parameters of the VAE (the parameters of the encoder and decoder) can be fixed, which can ensure that the training of the generator and discriminator will not be interfered by the update of the VAE parameters. Thus, the generator and discriminator of the GAN model can focus more on learning how to generate and recognize real data. The VAE - GAN model ensures the authenticity of data generation through the discriminator. By fixing the parameters of the VAE and updating the parameters of the discriminator and generator, the discriminator can better distinguish real and generated data, and at the same time, the decoder can generate more realistic data. Since the VAE model consists of two parts: the encoder and the decoder, and the GAN model consists of two parts: the generator and the discriminator. Although the generator is not used in the VAE - GAN model, each structure has its own independent parameters, and the update of each parameter of the model depends on the value of the loss function. Therefore, although the VAE - GAN model in this application does not have the structure of the generator, it still uses the generator loss function.
[0124] Specifically, the loss function of the discriminator is used to train the discriminator so that it can better distinguish real data and generated data. The discriminator loss consists of two parts:
[0125] 1. Loss of real data:
[0126]
[0127] where, the Loss real represents the original loss value, represents the weighted average value of the tensor data, and D(x) represents the original probability value of the discriminator for the tensor data (real data);
[0128] 2. Loss of the reconstructed data generated by the decoder:
[0129]
[0130] where, the Loss fake represents the reconstruction loss value, represents the weighted average value of the reconstructed data, G(z) represents the fake data generated by the generator, and D(G(z)) represents the reconstruction probability value of the discriminator for the reconstructed data (fake data);
[0131] The discriminator loss value of the GAN model is the sum of the loss of real data and the loss of the reconstructed data generated by the decoder.
[0132] The loss function of the generator is used to train the generator so that the fake data it generates can deceive the discriminator. The generator loss is:
[0133]
[0134] Among them, the Generator Loss represents the generator loss value, and the VAE Total Loss represents the total loss value. represents the weighted mean of the reconstructed data, and D(G(z)) represents the reconstruction probability value of the discriminator for the reconstructed data (fake data).
[0135] The total loss function of the VAE-GAN fusion model is:
[0136] VAE-VAE Total Loss = VAE Total Loss + λ * Generator Loss;
[0137] Among them, VAE-GAN Total Loss represents the total loss value of the VAE-GAN fusion model, and λ represents a hyperparameter used to balance the VAE loss and the GAN loss.
[0138] The present invention also provides an industrial Internet traffic sample expansion system based on VAE-GAN, which includes multiple modules, and the multiple modules are used to implement the steps of any one of the above methods.
[0139] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium provided in the present application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0140] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article or method comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, apparatus, article or method comprising such element.
[0141] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A method for expanding industrial Internet traffic samples based on VAE-GAN, characterized in that: include: Obtain original training data and preprocess the original training data to obtain original tensor data; Input the original tensor data into the VAE encoder to extract multiple feature vectors corresponding to the original tensor data; The plurality of feature vectors are passed through a first fully connected layer of a VAE encoder to generate a plurality of context feature vectors; The plurality of context feature vectors are passed through a second fully connected layer of a VAE encoder to generate latent variable data; Input the latent variable data into the VAE decoder for data expansion to obtain the reconstructed data; Input the reconstructed data and the original tensor data into the discriminator of the GAN model to generate evaluation results; Determining whether the evaluation result meets the preset conditions; If the evaluation result does not meet the preset conditions, the discriminator generates feedback information according to the evaluation result, the VAE decoder adjusts its own parameters according to the feedback information, regenerates the reconstruction data, and returns to the step of inputting the reconstruction data and the original tensor data into the discriminator of the GAN model to generate the evaluation result; If the reconstructed data matches the original tensor data according to a preset condition, the reconstructed data is output and used as a flow sample.
2. The industrial Internet traffic sample expansion method based on VAE-GAN according to claim 1 is characterized in that: The step of obtaining target training data and preprocessing the target training data to obtain original tensor data includes: Obtaining original data sets, where the original data sets include industrial public data, simulated industrial scene data, and real industrial scene data; The original data set is segmented according to the data stream level to obtain multiple streams, where each stream contains a fixed number of traffic packets; Performing data cleaning on multiple traffic packets, and slicing each cleaned traffic packet according to a preset byte length to obtain multiple data fragments; The multiple data fragments in each traffic packet are scaled proportionally according to a preset ratio to obtain multiple multidimensional tensors corresponding to the multiple data fragments, and all multidimensional tensors of the multiple traffic packets are integrated to obtain the original tensor data.
3. The industrial Internet traffic sample expansion method based on VAE-GAN according to claim 1 is characterized in that: The step of inputting the original tensor data into the VAE encoder to extract the feature vector corresponding to the original tensor data includes: The original tensor data is input into the two convolutional layers of the VAE encoder to extract the local feature vectors of the original tensor data; Build LSTM layers in the VAE encoder; Extract the time series feature vector of the original tensor data based on the LSTM layer; The local feature vector and the time series feature vector are used as feature vectors corresponding to the original tensor data.
4. The industrial Internet traffic sample expansion method based on VAE-GAN according to claim 1 is characterized in that: The step of generating latent variable data from the plurality of context feature vectors via a second fully connected layer of a VAE encoder comprises: Inputting the plurality of context feature vectors into the second fully connected layer of the VAE encoder to map the plurality of context feature vectors to a latent space, and calculating the mean, variance and standard deviation corresponding to the plurality of context feature vectors in the latent space; Generate multiple target feature vectors by random sampling based on the means and variances corresponding to multiple context feature vectors; Get multiple random noises; Randomly fuse multiple random noises with multiple target feature vectors to obtain multiple fusion vectors; The plurality of fused vectors generate latent variable data based on the reparameterization technique principle.
5. The industrial Internet traffic sample expansion method based on VAE-GAN according to claim 1 is characterized in that: The step of inputting the latent variable data into the VAE decoder for data expansion to obtain reconstructed data includes: The latent variable data is input into the fully connected layer of the VAE decoder for expansion to obtain the intermediate feature vector; Input the intermediate feature vector into the bidirectional LSTM layer of the VAE decoder, and restore the length and number of channels of the intermediate feature vector based on the principle of the deconvolution layer; Based on the length and the number of channels of the intermediate feature vector, reconstructed data having the same shape as the original tensor data is generated.
6. The method for expanding industrial Internet traffic samples based on VAE-GAN according to claim 5 is characterized in that: After the step of generating the reconstructed data having the same shape as the original tensor data, the method further comprises: Calculate the mean square error between the reconstructed data and the original tensor data based on the reconstruction loss function; Regularizing the latent space of the latent variable data based on KL divergence to obtain a KL divergence value; Generate a total loss value of the VAE decoder based on the mean square error and the KL divergence value; Optimizing parameters of the VAE decoder based on the total loss value; The latent variable data is input into the VAE decoder after parameter optimization for expansion to generate optimized data, which is used as the reconstructed data.
7. The method for expanding industrial Internet traffic samples based on VAE-GAN according to claim 1 is characterized in that: The step of inputting the reconstructed data and the original tensor data into the discriminator of the GAN model to generate an evaluation result includes: The reconstructed data and the original tensor data are respectively subjected to the convolution layer and the pooling layer of the GAN model discriminator to extract the reconstructed features and the original features; Inputting the reconstructed features and the tensor features into a fully connected layer of a GAN model discriminator respectively, so as to map the reconstructed features and the tensor features into a reconstructed probability value and an original probability value respectively; The reconstructed probability value and the original probability value are taken as evaluation results.
8. The method for expanding industrial Internet traffic samples based on VAE-GAN according to claim 1 is characterized in that: The step of the discriminator generating feedback information according to the evaluation result comprises: Fixing parameters of the VAE encoder and decoder; Obtain the reconstructed probability value and the original probability value in the evaluation result; Generate a discriminator loss value of a discriminator of a GAN model according to the original probability value and the reconstructed probability value; Obtaining a weighted average of the reconstructed data and a total loss value of the VAE decoder; Constructing a generator loss function of the GAN model based on the weighted mean, the reconstruction probability value and the total loss value of the VAE decoder; Constructing a total loss function of a VAE-GAN fusion model based on the generator loss function of the GAN model and the total loss value of the VAE decoder; The discriminator of the GAN model generates feedback information based on the total loss function.
9. An industrial Internet traffic sample expansion system based on VAE-GAN, comprising multiple modules, characterized in that: A plurality of modules are used to implement the steps of the method according to any one of claims 1 to 8.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Software measurement defect data augmentation method based on VAE and WGAN
CN115630612A
Expansion method and device of unbalanced data set and storage medium
CN119149980A
Automated Reservoir Modeling Using Deep Generative Networks
US20200183047A1
Data anomaly detection method and apparatus
WO2023123941A1
Cited By
Network traffic data noise reduction method and device, equipment and storage medium
CN120455173A
Industrial control abnormal flow detection method and system based on coupling variational auto-encoder
CN121644205A