Network attack sample generation method based on diffusion model
Generating network attack samples with similar distributions through one-dimensional hybrid diffusion model solves the problems of low sample generation efficiency and insufficient quality in the existing technology, and improves the network attack detection accuracy of IoT systems.
Patent Information
- Application Number
- CN202411044467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-06
AI Technical Summary
When the existing technology generates high-quality and diverse network attack samples, computing resources are consumed very much, making it difficult to meet the efficiency requirements of network attack detection in IoT systems. High-quality network attack samples are scarce, resulting in the detection model facing There are high false alarm rates and missed rates for new and complex attacks.
The one-dimensional hybrid diffusion model is used to learn the collected attack data, generate new network attack samples with similar distributions, and build network attack samples to generate deep network models by capturing nonlinear and timing characteristics in the data to achieve sample expansion and quality promote.
It significantly increases the number and quality of the cyber attack samples, bringing them closer to the real attack scenario, improves the accuracy of cyber attack detection in IoT systems, and reduces the false alarm rate and missed alarm rate.
Smart Images

Figure CN119094158A_ABST
Abstract
Description
Technical Field
[0001] Based on the Internet of Things technology, the present invention constructs a method for generating network attack samples based on a diffusion model. The collected attack data is learned using a one-dimensional hybrid diffusion model, and new network attack samples with similar distribution are generated. The generated samples are used to improve the accuracy of the network attack detection model in the Internet of Things system. The present invention belongs to the field of network security, and specifically relates to network attack sample generation and detection technology, which can improve the level of network security protection in the Internet of Things environment. Background Art
[0002] With the rapid development of Internet of Things technology, more and more devices are connected to the network, forming a huge Internet of Things ecosystem. Internet of Things devices are widely used in various fields such as smart homes, smart cities, industrial automation, medical health, etc., greatly improving production efficiency and convenience of life. However, due to limited resources and imperfect security mechanisms, Internet of Things devices have become the main target of network attacks. These attacks not only threaten personal privacy and data security, but may also have a serious impact on public safety and the economy. Therefore, improving the network security protection capabilities of the Internet of Things system has become an urgent problem to be solved, and the research results of the present invention have broad application prospects.
[0003] In network attack detection, the performance of the detection model is highly dependent on the quality and quantity of training data. In reality, high-quality network attack samples are often scarce and difficult to meet the needs of model training. This causes existing detection models to show high false alarm and false negative rates when facing new and complex attacks. Although traditional sample generation methods, such as generative adversarial networks and variational autoencoders, can generate a certain number of samples, they are still insufficient in processing complex nonlinear features and maintaining the consistency of sample distribution. These methods often require a lot of computing resources and time when generating high-quality and diverse attack samples, which makes it difficult to meet the efficiency requirements in practical applications.
[0004] The present invention proposes a method for generating network attack samples based on a diffusion model, which realizes the expansion of network attack samples and improves the accuracy of the detection network. The method uses a one-dimensional mixed diffusion model to learn the collected attack data, and generates new network attack samples with similar distribution by capturing the nonlinear and time series characteristics in the data. The generated samples can not only significantly increase the sample size and make up for the lack of actual data, but also improve the quality of the samples, making them closer to real attack scenarios. Therefore, the method for generating network attack samples based on a diffusion model proposed in the present invention can solve the problem of insufficient network attack samples in the Internet of Things system, improve the accuracy of the detection network, and provide an effective method for network attack detection in the Internet of Things system. Summary of the invention
[0005] The present invention proposes a distributed simulation system for Internet of Things network attacks. This simulation system can not only receive environmental data in real time, but also has a controllable network attack insertion function. It can simulate various network attack scenarios in a simulation environment, observe their impact on the Internet of Things system, and collect key network attack data.
[0006] The present invention adopts the following technical solutions and implementation steps:
[0007] A method for generating network attack samples based on a diffusion model, characterized by collecting multi-dimensional data, constructing a deep network model for generating network attack samples, and generating network attack samples, comprising the following steps:
[0008] (1) Multi-dimensional time series data sample collection
[0009] ① Set up N sensor clusters to collect time series data;
[0010] ② The sensor cluster in ① simultaneously collects time series data with a length of 100 sample points;
[0011] ③ In the process of data collection by the sensor cluster in ①, four types of network attacks are carried out and tags are added. The network attacks include distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks;
[0012] ④ The network attack data set D = {X, Y} is obtained from ③, the sample size is M, where the size of X is N × 100, and there are five types of labels Y, Y0 is the normal sample label, Y " , Y # , Y $ , Y % are abnormal sample labels, corresponding to distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks;
[0013] (2) Construction of deep network model for network attack sample generation
[0014] ① Set the position encoder pe: The position encoding in the network attack sample generation deep network model generates a position vector by calculating the sine and cosine functions of each position. The position encoding formula is:
[0015]
[0016] Among them, pos represents the position index in the input sequence, and its value range is [0,99]; i is the dimension index of the position encoding, and its value range is [0,63];
[0017] ②Build a model for generating the rth type of network attack samples The value range of r is [1,4], and x* is the n-th dimension input, k is the number of noise adding steps, and its value range is [0,100]. The model structure includes an input layer, three layers of downsampling and upsampling modules, a skip connection layer, and an output layer;
[0018] The input layer receives samples x of length 100 and batch size 256. * , and passes through a one-dimensional convolution layer conv_u1 with a convolution kernel of 64;
[0019] In the first layer of downsampling and upsampling modules, the downsampling module conv_d1 uses a convolution kernel of 128 and performs downsampling through the maximum pooling layer maxPooling_1 with a pooling window size of 2. The upsampling module conv_u1 uses a convolution kernel of 64 and performs dimension alignment through the position encoding linear transformation pe;
[0020] In the second layer of downsampling and upsampling modules, the downsampling module conv_d2 uses a convolution kernel of 256 and performs downsampling through the maximum pooling layer maxPooling_2 with a pooling window size of 2. The upsampling module conv_u2 uses a convolution kernel of 128 and performs dimension alignment through the position encoding linear transformation pe.
[0021] In the third layer of downsampling and upsampling modules, the downsampling module conv_d3 uses a convolution kernel of 512 and performs downsampling through the maximum pooling layer maxPooling_3 with a pooling window size of 2. The upsampling module conv_u3 uses a convolution kernel of 512 and performs dimension alignment through the position encoding linear transformation pe;
[0022] The skip connection layer concatenates the downsampled features and upsampled features of the corresponding level, and transforms pe linearly through the encoding;
[0023] The output layer uses a one-dimensional convolution layer conv_o with a convolution kernel of 1, and the output in is a Gaussian random distribution, which is used as the input of the n-dimensional model;
[0024] ③ Construct the loss function L of the network attack sample generation model of the n-th dimension data, the formula is:
[0025]
[0026] Among them, ε is Gaussian random noise, the length is 100, k is the number of noise adding steps, the value range is [0,100], Represents the input data x * , time step k and noise ε are used for expectation calculation, For the original sample x of the given nth dimension *And the noisy samples obtained by Gaussian random noise ε are used as model input, is the k-th step noise control parameter of the n-th dimension data, and takes random values at each step from 0 to 100, with a range of [0.0001, 0.02]. represents the product of all noise control parameters before k-step noise addition, The model for generating the r-th type of network attack samples is n-th, and m is a dimension other than n-dimensional. The probability density function formula of Gaussian random noise ε is:
[0027]
[0028] Where exp(·) is an exponential function, l is a random variable in Gaussian random noise;
[0029] (3) Network attack sample generation
[0030] ① Network attack samples are generated step by step, where the n-th dimension sample is generated in the k-th step It is the k+1th step Reverse generation, the formula is:
[0031]
[0032] ② Generate the rth type of network attack samples, where the nth dimension sample generation formula is:
[0033]
[0034] in, Generate a deep network model for attacking samples through the network The generated n-th dimension label is Y : A sample of is a Gaussian random distribution;
[0035] ③Generate N-dimensional network attack samples
[0036] ④ Generate data for all 4 types of network attack samples to complete the network attack sample generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a rendering of a network attack sample generation method based on a diffusion model. DETAILED DESCRIPTION
[0038] 1. A method for generating network attack samples based on a diffusion model, characterized by collecting multi-dimensional data, constructing a deep network model for generating network attack samples, and generating network attack samples, comprising the following steps:
[0039] (1) Multi-dimensional time series data sample collection
[0040] ① Set up N sensor clusters to collect time series data;
[0041] ② The sensor cluster in ① simultaneously collects time series data with a length of 100 sample points;
[0042] ③ In the process of data collection by the sensor cluster in ①, four types of network attacks are carried out and tags are added. The network attacks include distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks;
[0043] ④ The network attack data set D = {X, Y} is obtained from ③, the sample size is M, where the size of X is N × 100, and there are five types of labels Y, Y0 is the normal sample label, Y " , Y # , Y $ , Y % are abnormal sample labels, corresponding to distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks;
[0044] (2) Construction of deep network model for network attack sample generation
[0045] ① Set the position encoder pe: The position encoding in the network attack sample generation deep network model generates a position vector by calculating the sine and cosine functions of each position. The position encoding formula is:
[0046]
[0047] Among them, pos represents the position index in the input sequence, and its value range is [0,99]; i is the dimension index of the position encoding, and its value range is [0,63];
[0048] ②Build a model for generating the rth type of network attack samples The value range of r is [1,4], and x * is the n-th dimension input, k is the number of noise adding steps, and its value range is [0,100]. The model structure includes an input layer, three layers of downsampling and upsampling modules, a skip connection layer, and an output layer;
[0049] The input layer receives samples x of length 100 and batch size 256. * , and passes through a one-dimensional convolution layer conv_u1 with a convolution kernel of 64;
[0050] In the first layer of downsampling and upsampling modules, the downsampling module conv_d1 uses a convolution kernel of 128 and performs downsampling through the maximum pooling layer maxPooling_1 with a pooling window size of 2. The upsampling module conv_u1 uses a convolution kernel of 64 and performs dimension alignment through the position encoding linear transformation pe;
[0051] In the second layer of downsampling and upsampling modules, the downsampling module conv_d2 uses a convolution kernel of 256 and performs downsampling through the maximum pooling layer maxPooling_2 with a pooling window size of 2. The upsampling module conv_u2 uses a convolution kernel of 128 and performs dimension alignment through the position encoding linear transformation pe.
[0052] In the third layer of downsampling and upsampling modules, the downsampling module conv_d3 uses a convolution kernel of 512 and performs downsampling through the maximum pooling layer maxPooling_3 with a pooling window size of 2. The upsampling module conv_u3 uses a convolution kernel of 512 and performs dimension alignment through the position encoding linear transformation pe;
[0053] The skip connection layer concatenates the downsampled features and upsampled features of the corresponding level, and transforms pe linearly through the encoding;
[0054] The output layer uses a one-dimensional convolution layer conv_o with a convolution kernel of 1, and the output in is a Gaussian random distribution, which is used as the input of the n-dimensional model;
[0055] ③ Construct the loss function L of the network attack sample generation model of the n-th dimension data, the formula is:
[0056]
[0057] Among them, ε is Gaussian random noise, the length is 100, k is the number of noise adding steps, the value range is [0,100], Represents the input data x * , time step k and noise ε are used for expectation calculation, For the original sample x of the given nth dimension * And the noisy samples obtained by Gaussian random noise ε are used as model input, is the k-th step noise control parameter of the n-th dimension data, and takes random values at each step from 0 to 100, with a range of [0.0001, 0.02]. represents the product of all noise control parameters before k-step noise addition, The model for generating the r-th type of network attack samples is n-th, and m is a dimension other than n-dimensional. The probability density function formula of Gaussian random noise ε is:
[0058]
[0059] Where exp(·) is an exponential function, l is a random variable in Gaussian random noise;
[0060] (3) Network attack sample generation
[0061] ① Network attack samples are generated step by step, where the n-th dimension sample is generated in the k-th step It is the k+1th step Reverse generation, the formula is:
[0062]
[0063] ② Generate the rth type of network attack samples, where the nth dimension sample generation formula is:
[0064]
[0065] in, Generate a deep network model for attacking samples through the network The generated n-th dimension label is Y : A sample of is a Gaussian random distribution;
[0066] ③Generate N-dimensional network attack samples
[0067] ④ Generate data for all 4 types of network attack samples to complete the network attack sample generation.
Claims
1. A network attack sample generation method based on a diffusion model, characterized in that The following steps are involved: (1) Multi-dimensional time series data sample collection ① Set up N sensor clusters to collect time series data; ② The sensor cluster in ① simultaneously collects time series data with a length of 100 sample points; ③ In the process of data collection by the sensor cluster in ①, four types of network attacks are carried out and tags are added. The network attacks include distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks; ④ The network attack data set D = {X, Y} is obtained from ③, the sample size is M, where the size of X is N × 100, and there are five types of labels Y, Y0 is a normal sample label, Y1, Y2, Y3, Y4 are abnormal sample labels, corresponding to distributed denial of service attacks, IP port scanning attacks, abnormal data frequency attacks, and erroneous data content attacks, respectively; (2) Construction of deep network model for network attack sample generation ① Set the position encoder pe: The position encoding in the network attack sample generation deep network model generates a position vector by calculating the sine and cosine functions of each position. The position encoding formula is: Among them, pos represents the position index in the input sequence, and its value range is [0, 99]; i is the dimension index of the position encoding, and its value range is [0, 63]; ②Build a model for generating network attack samples of type r The value range of r is [1, 4], and x n is the n-th dimension input, k is the number of noise adding steps, and its value range is [0, 100]. The model structure includes an input layer, three layers of downsampling and upsampling modules, a skip connection layer, and an output layer; The input layer receives samples x of length 100 and batch size 256. n , and passes through a one-dimensional convolution layer conv_u1 with a convolution kernel of 64; In the first layer of downsampling and upsampling modules, the downsampling module conv_d1 uses a convolution kernel of 128 and performs downsampling through the maximum pooling layer maxPooling_1 with a pooling window size of 2. The upsampling module conv_u1 uses a convolution kernel of 64 and performs dimension alignment through the position encoding linear transformation pe; In the second layer of downsampling and upsampling modules, the downsampling module conv_d2 uses a convolution kernel of 256 and performs downsampling through the maximum pooling layer maxPooling_2 with a pooling window size of 2. The upsampling module conv_u2 uses a convolution kernel of 128 and performs dimension alignment through the position encoding linear transformation pe. In the third layer of downsampling and upsampling modules, the downsampling module conv_d3 uses a convolution kernel of 512 and performs downsampling through the maximum pooling layer maxPooling_3 with a pooling window size of 2. The upsampling module conv_u3 uses a convolution kernel of 512 and performs dimension alignment through the position encoding linear transformation pe; The skip connection layer concatenates the downsampled features and upsampled features of the corresponding level, and transforms pe linearly through the encoding; The output layer uses a one-dimensional convolution layer conv_o with a convolution kernel of 1, and the output in is a Gaussian random distribution, which is used as the input of the n-dimensional model; ③ Construct the loss function L of the network attack sample generation model of the n-th dimension data, the formula is: Among them, ε is Gaussian random noise, the length is 100, k is the number of noise adding steps, the value range is [0, 100], Represents the input data x n , time step k and noise ε are used for expectation calculation, For the original sample x of the given nth dimension n And the noisy samples obtained by Gaussian random noise ε are used as model input, is the k-th step noise control parameter of the n-th dimension data, and takes random values at each step from 0 to 100, with a range of [0.0001, 0.02]. represents the product of all noise control parameters before k-step noise addition, The model for generating the r-th type of network attack samples is n-th, and m is a dimension other than n-dimensional. The probability density function formula of Gaussian random noise ε is: Where exp(·) is an exponential function, l is a random variable in Gaussian random noise; (3) Network attack sample generation ① Network attack samples are generated step by step, where the n-th dimension sample is generated in the k-th step It is the k+1th step Reverse generation, the formula is: ② Generate the rth type of network attack samples, where the nth dimension sample generation formula is: in, Generate a deep network model for attacking samples through the network The generated n-th dimension label is a sample of Yr, is a Gaussian random distribution; ③Generate N-dimensional network attack samples ④ Generate data for all 4 types of network attack samples to complete the network attack sample generation.
