Flow detection implementation method based on generative adversarial network
By applying a GAN-based composite residual model in mobile traffic prediction, the problem that traditional methods are difficult to capture the complex characteristics of traffic data is solved, and higher prediction precision and accuracy are achieved, meeting the demand for accurate traffic prediction of modern wireless networks.
Patent Information
- Application Number
- CN202311498246.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-13
AI Technical Summary
Traditional mobile traffic prediction methods are difficult to effectively capture the complex characteristics of traffic data in the time and space domains, resulting in insufficient prediction precision and cannot meet the demand for accurate traffic prediction in modern wireless networks.
The composite residual model based on the Generative Adversarial Network (GAN) is adopted, and the eigenvalues of space-time correlation are extracted through three-dimensional convolution operations, and network training is accelerated through the composite residual structure to avoid model crashes and improve prediction accuracy.
It realizes deep spatial feature extraction of mobile traffic data, improves the precision of traffic prediction, and can more accurately predict mobile traffic changes within the city, providing a better reference for network architecture deployment.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
[0001] This patent provides a mobile traffic prediction model using a generative adversarial network, which enables the model to extract deep spatial features from mobile traffic data and improve the precision of traffic prediction. In practical applications, different prediction models are compared and experiments are conducted to summarize which model predicts the best mobile traffic, providing a reference for operators to deploy network architecture within the city. It has an important impact on the capacity planning of wireless network cellular networks, the judgment of traffic changes in the network, and the configuration and deployment of equipment in the network. The real traffic data in the city is spatially mapped, and aggregation is completed according to the time and space correlation of the traffic to obtain a two-dimensional input data. The spatial correlation analysis of the traffic data shows that the mobile traffic within the city has great correlation characteristics in the spatial domain. A composite residual model based on a generative adversarial network is designed according to the spatial complexity of the data. The spatial feature value extraction of the traffic data is completed through a deep convolutional network, and the back propagation process of the network training is accelerated through the composite residual structure, which avoids model collapse and accelerates the convergence effect. Finally, a more accurate prediction result is obtained. Background Art
[0002] The rapid development of personal mobile communication technology has become one of the most successful innovative technologies since this century. More and more people rely entirely on the support of mobile devices in their lives, work and even entertainment activities. This has led to the rapid development and widespread popularity of mobile devices, which has prompted the improvement of mobile application and mobile service standards, and at the same time has put unprecedented high requirements on wireless network infrastructure. The widespread popularity of mobile services has led to a surge in mobile traffic. The massive and diverse data brought by the growth of more and more mobile services has increased the burden on operators to build cellular networks. Being able to build the most suitable cellular network architecture in the most cost-effective way is the goal that operators hope to achieve. The prediction of network traffic directly affects the operator's control of network performance, the allocation of network resources, and call access control. In traditional networks, traffic data is relatively evenly distributed in the time dimension and space dimension. With the development and maturity of 4G and 5G, the types of services are gradually increasing, and the diversification of traffic characteristics has also begun to emerge. The modeling and prediction methods for traditional traffic are gradually no longer applicable. Traditional traffic prediction and reconstruction methods require a lot of modeling and analysis of traffic data to obtain the unique characteristics of traffic. As the complexity of traffic data increases, this work becomes more difficult, and there is no very good solution for large and complex traffic data. However, due to its black-box learning method, deep learning can fully demonstrate its self-adaptation, self-learning, and self-organization when processing huge raw data. In traditional machine learning, it takes a very high cost to select features in order to make accurate inferences and decisions based on these data. Generative adversarial networks use a hierarchical feature extraction method, which can effectively extract feature information and obtain more abstract correlations from the data, while minimizing the workload of data preprocessing. Summary of the invention
[0003] We proposed a model based on the generative adversarial network (GAN). Through the generative adversarial network, the game process between the generator and the discriminator generates data with the smallest error from the actual value. Through the three-dimensional convolution operation, more feature values with more spatial and temporal correlation are extracted. And the extracted traffic features are strengthened by using a deep network. Adding a residual structure speeds up the training process of the model and prevents the problems of gradient descent and gradient vanishing. By setting the coarseness of the input data, we found that the smaller the coarseness of the input data, the better the prediction result, but the error for GAN is not large. However, the error of the traditional model increases rapidly after adjusting the input coarseness, resulting in a huge difference from the actual value. We can obtain that for mobile traffic, the mapping of mobile traffic can be obtained according to their spatial and temporal correlation, and according to their spatial correlation, the task of predicting from rough traffic concentration to accurate traffic data can be completed. The traditional interpolation method can predict the approximate distribution but lacks the authenticity of the data, while the neural network method can solve the accurate prediction of local large-scale traffic.
[0004] 1. Data preparation
[0005] Collect and prepare a dataset for training GAN. The dataset should contain historical traffic data, such as hourly or daily network traffic data. The dataset should contain enough data to ensure that GAN can learn the patterns and trends of traffic data. The dataset should contain data from the following aspects: 1. Historical traffic data mainly includes hourly or daily network traffic data. 2. Network topology mainly includes devices and connections in the network. 3. Network configuration information mainly includes configuration information of devices such as routers, switches, and firewalls in the network.
[0006] 2. Training the GAN model
[0007] The GAN model is built using the deep learning framework (PyTorch). The GAN model consists of two neural networks: the generator and the discriminator. The generator is responsible for generating fake traffic data, while the discriminator is responsible for distinguishing between real traffic data and fake traffic data. The network model structure diagram of the GAN model generator is as follows: Figure 2 As shown, the network model structure of the discriminator is as follows Figure 3 shown.
[0008] The input of the generator is a noise vector, and the output is a fake traffic data. The input of the discriminator is a traffic data, and the output is a binary classification result, indicating whether the input data is real or fake. The training process of GAN is a zero-sum game, where the generator and the discriminator compete with each other to improve their performance.
[0009] 3. Train the GAN model using the dataset.
[0010] During training, the generator and discriminator compete with each other to improve their performance. Training a GAN model requires a lot of computing resources and time. The training process of GAN can be divided into the following steps:
[0011] (1) Randomly generate some noise vectors as input to the generator.
[0012] (2) The generator uses noise vectors to generate false traffic data.
[0013] (3) The discriminator is trained using real traffic data and fake traffic data to distinguish real traffic data from fake traffic data.
[0014] (4) The generator and discriminator compete with each other to improve their performance.
[0015] (5) After training, the generator can generate false data that is similar to real data.
[0016] 4. Traffic prediction
[0017] Use the trained GAN model to predict traffic. The generator can generate fake traffic data, which can be used to predict future traffic trends. The fake data generated by the generator should be similar to the real data to ensure the accuracy of the prediction. The process of traffic prediction can be divided into the following steps:
[0018] (1) Use the generator to generate fake traffic data.
[0019] (2) Use time series analysis or machine learning techniques to predict false traffic data.
[0020] (3) Convert the prediction results into real traffic data.
[0021] 5. Evaluate and optimize
[0022] Evaluate the performance of the GAN model and optimize it as needed. You can use various metrics to evaluate the performance of the GAN model, using mean squared error (MSE) and mean absolute error (MAE). If the performance of the GAN model is not good enough, you can try to adjust the model's hyperparameters or increase the size of the dataset.
[0023] 6. Advantages and Challenges of the Present Invention in Traffic Prediction
[0024] GAN has the following advantages in traffic prediction: 1. It can generate high-quality data GAN can generate false data that is similar to real data, which can be used to predict future traffic trends. The false data generated by the generator should be similar to the real data to ensure the accuracy of the prediction. 2. No need for manual annotation of data Traditional traffic prediction methods usually require a lot of manual intervention and adjustment, and the prediction accuracy is limited. Using GAN for traffic prediction does not require manual annotation of data, and can automatically learn the patterns and trends of the data. 3. It can handle complex data distributions GAN can handle complex data distributions, such as nonlinear data distributions. Traditional traffic prediction methods are usually based on linear models or time series analysis and cannot handle complex data distributions.
[0025] GAN also has some challenges in traffic prediction: 1. Complex training process The training process of GAN is relatively complex and requires a lot of computing resources and time. Training the GAN model requires the use of GPU or distributed computing to accelerate the training process. 2. Difficult model selection The performance of GAN is affected by the model structure and hyperparameters. It is challenging to select the appropriate model structure and hyperparameters. Different GAN models are suitable for different data sets and tasks, and the appropriate model needs to be selected according to the specific situation. 3. Dataset size limit The performance of GAN is affected by the size of the data set. The larger the data set, the better the performance of GAN. However, collecting and preparing large-scale data sets requires a lot of time and manpower costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the invention content of this patent and the technical solutions in the embodiments, the following is a brief introduction to the drawings used. The drawings described below are only some of the overall architecture and embodiments of this patent. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 It is a schematic diagram of the generative adversarial network of the present invention.
[0028] Figure 2 It is a network model structure diagram of the generator of the present invention.
[0029] Figure 3 It is a network model structure diagram of the discriminator of the present invention.
[0030] Figure 4 It is the back propagation graph of the generative adversarial network of the present invention.
[0031] Figure 5 It is an iterative loss graph of the generative adversarial network of the present invention.
[0032] Figure 6 is the composite residual block diagram used in the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of this patent clearer, the technical solutions in the embodiments of this patent will be clearly and completely described below in conjunction with the drawings in the embodiments of this patent. Obviously, the described embodiments are part of the embodiments of this patent, not all of them. Based on the embodiments in this patent, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this patent.
[0034] Steps for traffic prediction using GAN The steps for traffic prediction using GAN are as follows:
[0035] Step 1. Obtaining the dataset
[0036] Collect and prepare a dataset for training GAN. The dataset should contain historical traffic data, such as hourly or daily network traffic data. The dataset should contain enough data to ensure that GAN can learn the patterns and trends of traffic data. The dataset should include data on the following aspects:
[0037] 1.1Historical traffic data mainly includes hourly or daily network traffic data.
[0038] 1.2 Network topology mainly includes the devices and connections in the network.
[0039] 1.3 Network configuration information mainly includes the configuration information of routers, switches, firewalls and other devices in the network.
[0040] Step 2: Data Preprocessing
[0041] 2.1 Store the collected data sets in different folders and use them as training samples for generating adversarial networks.
[0042] Step 3: Build a conditional generative adversarial network consisting of a generator and a discriminator
[0043] 3.1 Construct the generator. The generator is mainly composed of convolutional layers, deconvolutional layers, and converters. The main function of the convolutional layer is to extract features from the input based on the convolutional network; the main function of the converter is to combine different similar features, and then perform domain conversion on the feature vector of the image based on the feature combination; the main function of the deconvolutional layer is to restore low-level features from the feature vector;
[0044] 3.2 Use the DenseNet network in the generator. DenseNet is a deep neural network that can connect each layer of the neural network to each other. The DenseNet network structure is shown in the figure: The connection method is mainly reflected in the feature output graphs of all layers before the current layer of the neural network as the input of this layer, and the output of this layer of the neural network as the input of all subsequent layers.
[0045] 3.4 Use the deep learning framework (PyTorch) to build a GAN model. The GAN model consists of two neural networks: the generator and the discriminator. The generator is responsible for generating fake traffic data, while the discriminator is responsible for distinguishing between real traffic data and fake traffic data.
[0046] 3.5 The input of the generator is a noise vector, and the output is a fake traffic data. The input of the discriminator is a traffic data, and the output is a binary classification result, indicating whether the input data is real or fake. The training process of GAN is a zero-sum game, where the generator and the discriminator compete with each other to improve their performance.
[0047] 3.6 Use the dataset to train the GAN model. During training, the generator and discriminator compete with each other to improve their performance. Training the GAN model requires a lot of computing resources and time. The training process of GAN can be divided into the following steps:
[0048] 3.6.1 Randomly generate some noise vectors as input to the generator.
[0049] 3.6.2 Generator generates fake traffic data using noise vectors.
[0050] 3.6.3 The discriminator is trained using real traffic data and fake traffic data to distinguish real traffic data from fake traffic data.
[0051] 3.6.4 The generator and discriminator compete with each other to improve their performance.
[0052] 3.6.5 After training, the generator can generate false data that is similar to real data.
[0053] Step 4: Design the loss function of the conditional generative adversarial network
[0054] 4.1 Loss of the discriminator The loss function should reject all traffic that is generated to pass the test, that is, set the corresponding output of the discriminator to 0;
[0055] 4.2 Loss of the discriminator The loss function should respond to all the original traffic, that is, set the corresponding output of the discriminator to 1;
[0056] 4.3 The loss function of the generator should realize that the generator should allow the discriminator to pass all the traffic output from the generator, thereby realizing the fooling operation of the generator, that is, setting the output of the discriminator to 1;
[0057] 4.4 The traffic generated by the generator should not only retain the characteristics of the input traffic, but also satisfy the loop consistency. That is, if generator G is used to generate fake traffic, it needs to be able to use generator F to reconstruct the original traffic.
[0058] 4.5 Based on the above, the overall loss function of the generative adversarial network is constructed, and the conditional generative adversarial network is trained to minimize the loss function, and the generator and discriminator are continuously optimized based on the loss function during the training process.
[0059] The above loss function is designed as:
[0060]
[0061] L(G, F, D X ,D Y )=λ1L GAN (G,D Y ,X,Y)+λ2L GAN (F,D X , Y, X)+λ3L cyc (G, F)
[0062] The cross entropy loss function is used in the above formula to calculate the generative adversarial loss. The min in the formula indicates that the goal of the generator is to make the value of the function as small as possible, and the max in the function indicates that the goal of the discriminator is to make the value of the function as large as possible. G and F are the first generator and the second generator; DX and DY are the first discriminator and the second discriminator respectively; λ1, 2, 3 are configurable parameters, which are mainly used to adjust the weights of the generative adversarial loss and the cycle consistency loss.
[0063] Step 5: Traffic Forecast
[0064] Use the trained GAN model to predict traffic. The generator can generate fake traffic data, which can be used to predict future traffic trends. The fake data generated by the generator should be similar to the real data to ensure the accuracy of the prediction. The process of traffic prediction can be divided into the following steps:
[0065] (4) Use the generator to generate false traffic data.
[0066] (5) Use time series analysis or machine learning techniques to predict false traffic data.
[0067] (6) Convert the prediction results into real traffic data.
[0068] Step 6: Evaluate and optimize
[0069] Evaluate the performance of the GAN model and optimize it as needed. You can use various metrics to evaluate the performance of the GAN model, using mean squared error (MSE) and mean absolute error (MAE). If the performance of the GAN model is not good enough, you can try to adjust the model's hyperparameters or increase the size of the dataset.
[0070] When the generative adversarial loss of the generative adversarial network model meets the preset convergence condition, the network model is trained.
Claims
1. A method for implementing traffic detection based on a generative adversarial network, characterized in that: In the field of network security technology, traffic monitoring is carried out by generating adversarial network technology, and the different coarseness of traffic data in the area to be predicted is included in the research scope.
2. The method according to claim 1, characterized in that: First, collect and prepare a dataset for training GAN on the network. The dataset should contain historical traffic data, such as hourly or daily network traffic data. The dataset should contain enough data to ensure that GAN can learn the patterns and trends of traffic data. The dataset should contain the following data:
1. Historical traffic data mainly includes hourly or daily network traffic data.
2. The network topology mainly includes the devices and connections in the network.
3. Network configuration information mainly includes the configuration information of devices such as routers, switches and firewalls in the network.
3. The method according to claim 1, characterized in that The collected data sets are stored in different folders and used as training samples for the generative adversarial network.
4. The method according to claim 1, characterized in that: Build a conditional generative adversarial network consisting of a generator and a discriminator, and use the deep learning framework (PyTorch) to build a GAN model. The GAN model consists of two neural networks: a generator and a discriminator. The generator is responsible for generating fake traffic data, while the discriminator is responsible for distinguishing between real traffic data and fake traffic data.
5. The method according to claim 1, characterized in that Design the loss function of the conditional generative adversarial network. The loss function of the discriminator should reject all generated traffic that wants to pass through, that is, set the corresponding output of the discriminator to 0; the loss function of the discriminator should respond to all original traffic, that is, set the corresponding output of the discriminator to 1.
6. The method according to claim 1, characterized in that Use the trained GAN model for traffic prediction. The generator can generate fake traffic data, which can be used to predict future traffic trends. The fake data generated by the generator should be similar to the real data to ensure the accuracy of the prediction.
Citation Information
Cited By
Small PLC (Programmable Logic Controller) data storage method for electro-hydraulic actuating mechanism
CN120354251A
Network traffic prediction method based on deep learning technology
CN121967248A