Adversarial training-based unsupervised intrusion detection system and method based on AE model optimization

Through adversarial training, the autoencoder model is optimized, and the problem of unstable model training in industrial Internet intrusion detection is solved, which improves the stability and performance of the detection system, and achieves more efficient intrusion detection.

CN116318773BActive Publication Date: 2025-08-26JINAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211504988.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2025-08-26
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

The existing autoencoder model is unstable in the industrial Internet intrusion detection, and the design relies on manual labor, making it difficult to adapt to dynamic environmental changes, resulting in insecure detection stability and inefficiency.

Method used

Adversarial training method based on the autoencoder model is adopted, combined with data decompression, preprocessing, offline optimization and online detection modules, through spectral residual technology, data normalization and sample processing, binary genetic optimization and adversarial training are used to optimize the autoencoder network model and improve detection capabilities.

Benefits of technology

It has improved the design stability and intelligence level of the industrial Internet intrusion detection system, improved performance indicators such as recall rate and F1 score, and enhanced the intrusion detection capabilities of industrial Internet systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116318773B_ABST
    Figure CN116318773B_ABST
Patent Text Reader

Abstract

The present invention discloses an industrial Internet adversarial training-based unsupervised intrusion detection system and method based on autoencoder model optimization. The present invention uses a data decompression module to collect the communication timing traffic of the industrial Internet system, obtains the input data set through data cleaning, data normalization and data sampling using spectral residual technology, binary encodes the architecture and parameters of the AE network model, designs an AE network model offline optimization platform based on binary genetic optimization technology, and uses adversarial training to evaluate individual fitness. After iterative optimization, the optimal AE network model of the industrial Internet intrusion detection system is automatically obtained. The present invention can not only realize the adversarial training and automatic optimization design of the AE model for the industrial Internet unsupervised intrusion detection system, improve the model training stability and intelligent design level of the industrial Internet intrusion detection system, but also improve the performance indicators such as the recall rate and F1 score of the industrial Internet system intrusion detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to intelligent intrusion detection technology in the field of information security of industrial Internet systems, and in particular to an adversarial training intrusion detection system and method based on autoencoder (AE) model optimization. Background Art

[0002] The Industrial Internet is the application and development of next-generation information technology, represented by the internet, in the industrial sector. In recent years, the scale of my country's Industrial Internet industry has exceeded one trillion yuan, accelerating the digital transformation of the manufacturing industry. While the Industrial Internet industry is developing rapidly and holds broad prospects, it also faces increasing security risks.

[0003] The Industrial Internet currently lacks a unified architecture and lacks standards and specifications. Dynamic changes in the software environment brought about by industrial upgrades have placed higher demands on the adaptability of intrusion detection models. The ever-changing security risks also place higher demands on the detection stability of intrusion detection models. In recent years, deep learning-based intrusion detection technology for Industrial Internet systems has become a hot research topic in academia and industry. Currently, the vast majority of deep neural network model architectures for intrusion detection in Industrial Internet systems are manually designed and developed by professionals, resulting in long design and development cycles and difficulty in dynamically adapting to the environment. Therefore, the level of automated design for Industrial Internet intrusion detection systems urgently needs to be improved.

[0004] Deep neural network model optimization design offers inherent advantages in addressing dynamically changing environmental risks and balancing computational costs with improved detection rates. However, existing research on deep neural network optimization design primarily focuses on traditional image recognition, with limited research on its application in intrusion detection for industrial internet systems.

[0005] Autoencoder models, a typical unsupervised method for intrusion detection in industrial internet systems, have high detection rates. However, existing autoencoder models suffer from training instability and a reliance on manual model design, severely restricting their widespread application in industrial internet intrusion detection. Adversarial training (learning), as an emerging technology, holds promise for addressing these issues, such as the single training objective and instability of autoencoder models. However, relevant technologies have yet to be reported. Given this, the development of novel adversarial training-based unsupervised intrusion detection technologies for industrial internet systems, based on optimized autoencoder network models, is urgently needed. Summary of the Invention

[0006] The purpose of the present invention is to address the deficiencies of the existing technology and provide an industrial Internet adversarial training unsupervised intrusion detection system and method based on AE model optimization.

[0007] The object of the present invention is to achieve the following technical solution: an industrial Internet adversarial training unsupervised intrusion detection system based on AE model optimization, characterized in that the system includes a data decompression module, a data preprocessing module, an autoencoder network model offline optimization module and an online detection module for industrial Internet intrusion detection;

[0008] The data decompression module of the industrial Internet intrusion detection system includes two submodules: data acquisition and data cleaning. The main function of the data acquisition module is to collect and summarize the time series data of the real-time sensors of the industrial Internet system. The main function of the data cleaning module is to use spectral residual technology to clean each data feature in the industrial Internet time series data; the cleaned data set is input into the data preprocessing module.

[0009] The data preprocessing module includes two submodules: data normalization and data sampling. The data normalization module calculates the extreme values ​​of each dimension in the data set to eliminate the dimension and accelerate the optimization process. The data sampling module divides the long time series data into block data to generate the final data set, which is used as the input of the autoencoder network model optimization module.

[0010] The autoencoder network model offline optimization module is to binary encode the autoencoder network model based on the final data set generated by the data preprocessing module, and use binary genetic optimization technology in combination with the individual fitness evaluation module to obtain the optimal autoencoder network model architecture and parameter information after iterative optimization; and at the same time input it into the online detection module;

[0011] The individual fitness evaluation module obtains the encoding information of each individual from the autoencoder network model offline optimization module, constructs an autoencoder AE and two discriminators D1 and D2, and through three-way adversarial training, discriminates the validation set samples according to the reconstruction loss of the autoencoder AE, calculates the validation set F1 score as the fitness value of each individual, and transmits the fitness value of each individual back to the autoencoder network model offline optimization module;

[0012] The online detection module, after receiving the architecture and parameter information of the optimal autoencoder network model, constructs the optimal autoencoder network model, performs anomaly detection on the real-time communication traffic of the industrial Internet, and determines whether the sample is abnormal;

[0013] The industrial Internet intrusion detection method based on autoencoder network model optimization of the system includes the following steps:

[0014] (1) The data decompression module in the industrial Internet intrusion detection system described in claim 1 collects and aggregates the time series data of the real-time sensors of the industrial Internet system, marks the collected data as x, and uses formula (1), formula (2), and formula (3) to perform Fourier transform on the data to obtain a logarithmic amplitude spectrum;

[0015] A(f)=Amplitude(F(x)) (1)

[0016] P(f)=Phrase(F(x)) (2)

[0017] L(f)=Log(A(f)) (3)

[0018] Where F(x) represents the Fourier transform of x; A(f) is the amplitude spectrum of the input sequence x, P(f) is the phase spectrum of the input sequence x, and L(f) is the logarithmic representation of the amplitude spectrum A(f). Use formulas (4) and (5) to calculate the spectral residual:

[0019] AL(f)=h q (f)·L(f) (4)

[0020] R(f)=L(f)-AL(f) (5)

[0021] Where AL(f) is the average spectrum of the logarithmic amplitude spectrum L(f), h q (f) is the convolution operation, R(f) is the spectral residual; the sequence is transformed back to the spatial domain using the inverse Fourier transform using formula (6);

[0022] S(x)=||F -1 (exp(R(f)+iP(f)))|| (6)

[0023] Among them F -1 () represents the inverse Fourier transform, and the time series data processed by the data decompression module is marked as S(x), and i represents the imaginary unit;

[0024] The data preprocessing module in the industrial Internet intrusion detection system described in claim 1 performs data normalization processing according to formula (7) after receiving the S(x) data, and marks the data set obtained after the normalization processing as X;

[0025]

[0026] Among them, X j Represents the feature of the j-th dimension of the dataset X, S j Represents the feature of the j-th dimension in the source dataset S, S jmax Represents the maximum value of the feature of the j-th dimension of the source dataset S, S jminrepresents the minimum value of the feature of the jth dimension of the source data set S, and m represents the maximum dimension value of the data set X; data sampling is to use the time series sliding window to intercept the time series data of a certain period of time according to formula (8) to generate the time series sample Y i , and then collect Y at every interval according to formula (9) i Included in W;

[0027]

[0028]

[0029] Among them, s w Indicates the sliding window length, s s represents the sliding window interval, X i represents the data of all dimensions at time point i in X, and M represents the length of the dataset X. The dataset obtained after data sampling is marked as W; the training set is marked as W train , the validation set is marked as W vali , the test set is labeled W test ;

[0030] (2) Setting the parameter values ​​of the offline optimization training module based on the autoencoder network model optimization, the parameter values ​​include the population size N, the autoencoder network model architecture and the number of iterative optimizations G for hyperparameter optimization max , the number of rounds E of autoencoder network model training, the latent space dimension LD of the autoencoder network model, the crossover rate β and the mutation rate σ in the binary genetic optimization solver;

[0031] (3) Randomly generate an initial population P0 consisting of N individuals, that is, P0 = {p1,…,p i ,…,p N ,1≤i≤N}, where p i represents the i-th individual in P0, p i Encode the hyperparameters and network architecture parameters of the autoencoder network model to be optimized into a BD-dimensional binary vector, p i The specific encoding of the position is shown in formula (10):

[0032] p i ={b1,…,b d ,…,b D},1≤d≤BD (10)

[0033] Among them, b d Represents the d-th binary value of the hyperparameters and network architecture parameters of the autoencoder network model, b d ∈{0,1}, and p iThe hyperparameters and network architecture parameters of the autoencoder network model corresponding to the position are marked as q i , that is, q i The real number vector representing the hyperparameters of the autoencoder network model and the network architecture parameters corresponding to the i-th individual is composed as shown in formula (11):

[0034]

[0035] Among them, [B, f, η] represents the hyperparameters used by the autoencoder network model, B represents the batch size used in the training of the autoencoder network model, f represents the type of optimizer used in the training of the autoencoder network model, f∈{adamax,adam,rmsprop,adadelta}, adamax represents Adaptive Moment Estimation Max optimization (Adamax), adam represents Adaptive Moment Estimation, rmsprop represents Root Mean Square Propogation, and adadelta represents the optimization solution method of accumulating the weighted sum of the differences between two adjacent iterations (i.e., iterative increments) based on the root mean square back propagation; η represents the learning rate used in the training of the autoencoder network model; L n Represents the number of convolutional layers in the autoencoder network model, layer j Represents the j-th convolutional layer, 1≤j≤n c , layer j The specific composition of is shown in formula (12):

[0036] layer j =[oc j ,ks j ,nt j ,af j ], 1≤j≤L n (12)

[0037] Among them, oc j Represents the number of convolution kernels in the jth convolution layer, ks j Represents the convolution kernel size of the j-th convolution layer, nt j Represents the normalization layer type connected to the j-th convolutional layer, nt j ∈{batchnorm,none}, batchnorm stands for batch normalization, none means no processing, af j Represents the activation function type of the j-th convolutional layer, af j∈{sigmoid,tanh,relu,none}, sigmoid represents the S-type function, tanh represents the hyperbolic tangent function, and relu represents the linear rectification function;

[0038] (4) The performance evaluation of the population P0 is performed as follows: the hyperparameters and network architecture real numbers q represented by each individual in P0 are i Converted into the corresponding autoencoder network model AE, that is, using q i layer j The relevant convolutional layer parameters are constructed layer by layer to form the encoder AE E , and use the same parameter mirror to construct the deconvolution layer to form the decoder AE D ; At the same time, use the pre-set discriminator network architecture parameters to build discriminators D1 and D2, and train the training data set W train As the data input of each autoencoder network model, E rounds of offline adversarial training are performed. The specific steps are as follows:

[0039] (4.1) For the discriminator D1 and encoder AE E Perform adversarial training, sample training set W train Passed into the autoencoder AE, the encoder AE E Generate a sample latent space q(z). Take the latent space q(z) and the prior distribution p(z) as the input of the discriminator D1, and let D1 judge whether the input is the prior distribution p(z) or the sample latent space q(z). The judgment result is compared with the true label, and the loss function is calculated according to formula (13). Then, the gradient descent technique is used to maximize the loss. D1 , and update the weight of the discriminator D1, the purpose of which is to enable D1 to have the ability to distinguish between the latent space q(z) and the prior distribution p(z);

[0040]

[0041] Among them, z represents the variable that obeys the prior distribution p(z), D1() represents the judgment result of the discriminator D1 on the variable, E represents the expected value of the distribution function, and p d (W) is the data distribution that the data sample W obeys.

[0042] (4.2) Adversarial training is performed on the discriminator D2 and the autoencoder AE, and the sample training set W trainThe data is passed into the autoencoder AE, and the reconstructed sample W' is finally output. Both the real sample W and the reconstructed sample W' are used as the input of the discriminator D2, and the discriminator D2 is allowed to judge whether the input is the real sample W or the reconstructed sample W'. The judgment result is compared with the real label, and the loss function is calculated according to formula (14). Then, the gradient descent technique is used to maximize the loss. D2 , and update the weight of the discriminator D2, the purpose of which is to enable D2 to have the ability to distinguish between real samples W and reconstructed samples W';

[0043]

[0044] Among them, D2() represents the judgment result of the discriminator D2 on the variable;

[0045] (4.3) Use formula (15) to calculate the real sample W train and reconstructed sample W' train The reconstruction loss MSE train ;

[0046]

[0047] Where MSE represents the mean square error loss, k represents the total number of samples W; then use formula (16) to calculate the loss function of AE:

[0048]

[0049] Use gradient descent technology to minimize Loss as much as possible AE , and update the weights of the autoencoder AE to improve the autoencoder AE's ability to reconstruct samples and strengthen its final detection ability; for the verification set W vali Perform the E2 round of validation test and obtain the average validation set reconstruction loss MSE corresponding to each individual according to formula (15): vali , the population P is calculated g The average validation set reconstruction loss MSE of all individuals in vali , the population P g The lowest MSE vali The corresponding individual is marked as the best individual G in the population 0best ;

[0050] (5) Set the initial number of iterations g = 1;

[0051] (6) The previous generation population P g-1 The optimal individual G (g-1)best Replicated into the contemporary population P g middle;

[0052] (7) Perform the selection operation of the bidding competition plan, that is, first use the uniformly distributed probability to select the previous generation population P g-1 Three individuals p a , p b , p c , select p a , p b , p c The two individuals with the highest fitness among the three individuals are selected as parents and marked as p d and p e ;

[0053] (8) Use formula (17) to uniformly generate a random array r1 with the same length as the genetic individual. Each bit r in array r1 is 1d is a random real number between 0 and 1 generated using normal distribution. 1d Determine whether it is less than the pre-set crossover rate β. If so, the parent p d and p e The dth bit of the individual code of p is cross-operated, that is, d and p e The codes of the individuals at position d are exchanged. The two individuals after the crossover are recorded as offspring and are labeled c1 and c2;

[0054] r1={r 11 ,…,r 1d ,…,r 1D},1≤d≤BD,0≤r 1d ≤1 (17)

[0055] Among them, r 11 , r 1d , r 1D Respectively represent the values ​​of the 1st dimension, dth dimension, and BDth dimension in the random array r1.

[0056] (9) Generate two random arrays r2 and r3 with the same length as the genetic individual by uniform distribution, i.e. r2 = {r 21 ,…,r 2d ,…,r 2D},1≤d≤BD,0≤r 2d ≤1, r3={r 31 ,…,r 3d ,…,r 3D},1≤d≤BD,0≤r 3d ≤1. For each bit r in array r2 2d Determine whether it is less than the pre-set mutation rate σ. If so, the d-th dimension code value in the offspring c1 is inverted. 3dDetermine whether it is less than the pre-set mutation rate σ. If so, the offspring c2 is inverted in the d-th dimension encoding value. Finally, add the offspring c1 and c2 to the contemporary population P. g middle;

[0057] (10) Repeat steps (6) to (9) until the contemporary population P g The size reaches the preset population size N;

[0058] (11) According to the performance evaluation process described in step (4), P g Each individual P in g Perform performance evaluation and obtain P g The best individual in the gbest ;

[0059] (12) If g <G max , then update g=g+1 and repeat steps (6) to (11); otherwise, go directly to the next step;

[0060] (13) According to the global optimal individual G finally obtained in the offline optimization training module best The optimal model information represented is used to construct the optimal autoencoder network model in the online detection module of industrial Internet intrusion detection;

[0061] (15) Use the online detection module to run the optimal autoencoder network model and perform the online detection on the dataset W test Perform online intrusion detection and calculate the performance indicators of intrusion detection such as precision, recall, and F1 score according to formulas (18) to (20);

[0062]

[0063]

[0064]

[0065] Among them, TP represents the number of normal industrial Internet data samples correctly predicted as normal classification, TN represents the number of abnormal industrial Internet data samples correctly predicted as abnormal classification, FP represents the number of abnormal industrial Internet data samples incorrectly predicted as normal classification, and FN represents the number of normal industrial Internet data samples incorrectly predicted as abnormal classification.

[0066] The beneficial effects of this patent are: compared with the existing technology, the present invention can realize the adversarial training of the autoencoder model and the automatic optimization design of the autoencoder model for the application field of industrial Internet intrusion detection, thereby improving the design stability and intelligent design level of the industrial Internet intrusion detection system; it also improves the performance indicators such as the recall rate and F1 score of the industrial Internet system intrusion detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 This is a schematic diagram of the principle of the industrial Internet adversarial training intrusion detection system and method based on autoencoder model optimization;

[0068] Figure 2 This is an example diagram of data sampling in the data preprocessing module;

[0069] Figure 3 This is an example diagram of how individual encoding information is converted into the corresponding autoencoder model;

[0070] Figure 4 This is a schematic diagram of the main process of adversarial training in the fitness evaluation module;

[0071] Figure 5 (a) is a comparison chart of the recall rate of the present invention's technology and the existing GDN (Graph Neural Network-Based Anomaly Detection in Multivariate Time Series) and USAD (USAD: UnSupervised Anomaly Detection on Multivariate Time Series) designed based on manual experience. Figure 5 (b) is a comparison chart of the F1 score indicators of the technology of the present invention, GDN and USAD. DETAILED DESCRIPTION

[0072] The present invention will be further described below with reference to the accompanying drawings, and the purpose and effects of the present invention will become more apparent.

[0073] Taking an industrial Internet system as an example, Figure 1 A schematic diagram of the principle of an adversarial training-based intrusion detection system and method based on AE model optimization is given. The adversarial training-based unsupervised intrusion detection system based on AE model optimization includes a data decompression module, a data preprocessing module, an autoencoder network model offline optimization module, and an online detection module for industrial Internet intrusion detection.

[0074] The data decompression module of the industrial Internet intrusion detection system includes two submodules: data acquisition and data cleaning. The main function of the data acquisition module is to collect and summarize the time series data of the real-time sensors of the industrial Internet system. The main function of the data cleaning module is to use spectral residual technology to clean each data feature in the industrial Internet time series data; the cleaned data set is input into the data preprocessing module.

[0075] The data preprocessing module includes two submodules: data normalization and data sampling. The data normalization module calculates the extreme values ​​of each dimension in the data set to eliminate the dimension and accelerate the optimization process. The data sampling module divides the long time series data into block data to generate the final data set, which is used as the input of the autoencoder network model optimization module.

[0076] The autoencoder network model offline optimization module is to binary encode the autoencoder network model based on the final data set generated by the data preprocessing module, and use binary genetic optimization technology in combination with the individual fitness evaluation module to obtain the optimal autoencoder network model architecture and parameter information after iterative optimization; and at the same time input it into the online detection module;

[0077] The individual fitness evaluation module obtains the encoding information of each individual from the autoencoder network model offline optimization module, constructs an autoencoder AE and two discriminators D1 and D2, and through three-way adversarial training, discriminates the validation set samples according to the reconstruction loss of the autoencoder AE, calculates the validation set F1 score as the fitness value of each individual, and transmits the fitness value of each individual back to the autoencoder network model offline optimization module;

[0078] The online detection module, after receiving the architecture and parameter information of the optimal autoencoder network model, constructs the optimal autoencoder network model, performs anomaly detection on the real-time communication traffic of the industrial Internet, and determines whether the sample is abnormal;

[0079] The system's adversarial training-based unsupervised industrial Internet intrusion detection method based on AE model optimization includes the following steps:

[0080] (1) The data decompression module in the industrial Internet intrusion detection system collects and aggregates the real-time sensor and other time series data of the industrial Internet system, marks the collected data as x, and uses formulas (1), (2), and (3) to perform Fourier transform on the data to obtain the logarithmic amplitude spectrum;

[0081] A(f)=Amplitude(F(x)) (1)

[0082] P(f)=Phrase(F(x)) (2)

[0083] L(f)=Log(A(f)) (3)

[0084] Where F(x) represents the Fourier transform of x; A(f) is the amplitude spectrum of the input sequence x, P(f) is the phase spectrum of the input sequence x, and L(f) is the logarithmic representation of the amplitude spectrum A(f). Use formulas (4) and (5) to calculate the spectral residual:

[0085] AL(f)=h q (f)·L(f) (4)

[0086] R(f)=L(f)-AL(f) (5)

[0087] Where AL(f) is the average spectrum of the logarithmic amplitude spectrum L(f), h q (f) is the convolution operation, R(f) is the spectral residual; the sequence is transformed back to the spatial domain using the inverse Fourier transform using formula (6);

[0088] S(x)=||F -1 (exp(R(f)+iP(f)))|| (6)

[0089] Among them F -1 () represents the inverse Fourier transform, and the time series data processed by the data decompression module is marked as S(x), and i represents the imaginary unit;

[0090] The data preprocessing module in the industrial Internet intrusion detection system, after receiving the S(x) data, performs data normalization according to formula (7) and marks the data set obtained after normalization as X;

[0091]

[0092] Among them, X j Represents the feature of the j-th dimension of the dataset X, S j Represents the feature of the j-th dimension in the source dataset S, S jmax Represents the maximum value of the feature of the j-th dimension of the source dataset S, S jmin represents the minimum value of the feature of the jth dimension of the source data set S, and m represents the maximum dimension value of the data set X; data sampling is to use the time series sliding window to intercept the time series data of a certain period of time according to formula (8) to generate the time series sample Y i , and then collect Y at every interval according to formula (9) i Included in W;

[0093]

[0094]

[0095] The sliding window length is s w =128, the sliding window interval is s s =10. X i Represents the data of all dimensions at time point i in X, and M represents the length of the dataset X. The example diagram of data sampling is as follows Figure 2 As shown, in this example, the length of the data set X = 13, using the sliding interval s s =3, window length s w =4 sliding window generates time series samples Y1 = {X1, X2, X3, X4}, Y4 = {X4, X5, X6, X7}, Y7 = {X7, X8, X9, X 10}, Y 10 ={X 10 ,X 11 ,X 12 ,X 13}, and construct the data set W = {Y1, Y4, Y7, Y 10}. The training set is labeled W train , the validation set is marked as W vali , the test set is labeled W test ;

[0096] (2) Setting the parameter values ​​of the offline optimization training module based on the autoencoder network model optimization, the parameter values ​​include the population size N=20, the autoencoder network model architecture and the number of iterative optimizations G for hyperparameter optimization max =30, the number of training rounds of the autoencoder network model E = 100, the latent space dimension of the autoencoder network model LD = 128, the crossover rate β in the binary genetic optimization solver = 0.8, and the mutation rate σ = 0.2;

[0097] (3) Randomly generate an initial population P0 consisting of N individuals, that is, P0 = {p1,…,p i ,…,p N ,1≤i≤N}, where p i represents the i-th individual in P0, p i Encode the hyperparameters and network architecture parameters of the autoencoder network model to be optimized into a BD-dimensional binary vector, p i The specific encoding of the position is shown in formula (10):

[0098] p i ={b1,…,b d ,…,b D},1≤d≤BD (10)

[0099] Among them, b d Represents the d-th binary value of the hyperparameters and network architecture parameters of the autoencoder network model, bd ∈{0,1}, and p i The hyperparameters and network architecture parameters of the autoencoder network model corresponding to the position are marked as q i , that is, q i The real number vector representing the hyperparameters of the autoencoder network model and the network architecture parameters corresponding to the i-th individual is composed as shown in formula (11):

[0100]

[0101] Among them, [B, f, η] represents the hyperparameters used by the autoencoder network model, B represents the batch size used in the training of the autoencoder network model, f represents the type of optimizer used in the training of the autoencoder network model, f∈{adamax,adam,rmsprop,adadelta}, adamax represents Adaptive Moment Estimation Max optimization (Adamax), adam represents Adaptive Moment Estimation, rmsprop represents Root Mean Square Propogation, and adadelta represents the optimization solution method of accumulating the weighted sum of the differences between two adjacent iterations (i.e., iterative increments) based on the root mean square back propagation; η represents the learning rate used in the training of the autoencoder network model; L n Represents the number of convolutional layers in the autoencoder network model, layer j Represents the j-th convolutional layer, 1≤j≤n c , layer j The specific composition of is shown in formula (12):

[0102] layer j =[oc j ,ks j ,nt j ,af j ], 1≤j≤n c (12)

[0103] Among them, oc j Represents the number of convolution kernels in the jth convolution layer, ks j Represents the convolution kernel size of the j-th convolution layer, nt j Represents the normalization layer type connected to the j-th convolutional layer, nt j ∈{batchnorm,none}, batchnorm stands for batch normalization, none means no processing, af j Represents the activation function type of the j-th convolutional layer, afj ∈{sigmoid,tanh,relu,none}, sigmoid represents the S-type function, tanh represents the hyperbolic tangent function, and relu represents the linear rectification function;

[0104] (4) The performance evaluation of the population P0 is performed as follows: the hyperparameters and network architecture real numbers q represented by each individual in P0 are i Converted into the corresponding autoencoder network model AE, that is, using q i layer j The relevant convolutional layer parameters are constructed layer by layer to form the encoder AE E , and use the same parameter mirror to construct the deconvolution layer to form the decoder AE D , Figure 3 An example diagram of converting individual encoding information into the corresponding autoencoder model is given; at the same time, the discriminators D1 and D2 are constructed according to the pre-set discriminator network architecture parameters. The discriminator network architecture parameters in this implementation case are set as follows: number of layers = 6, the number of convolution kernels from the 1st to the 6th layer are 32, 64, 128, 256, 512, and 1 respectively, the convolution kernel size from the 1st to the 6th layer is 4, the convolution kernel step size from the 1st to the 6th layer is 2, 2, 2, 2, 2, and 1 respectively, and the padding size from the 1st to the 6th layer is 1, 1, 1, 1, and 0 respectively; the training dataset W train As the data input of each autoencoder network model, E rounds of offline adversarial training are performed. Figure 4 A schematic diagram of the main process of adversarial training is given, and the specific steps are as follows;

[0105] (4.1) For the discriminator D1 and encoder AE E Perform adversarial training, sample training set W train Passed into the autoencoder AE, the encoder AE E Generate a sample latent space q(z). Take the latent space q(z) and the prior distribution p(z) as the input of the discriminator D1, and let D1 judge whether the input is the prior distribution p(z) or the sample latent space q(z). The judgment result is compared with the true label, and the loss function is calculated according to formula (13). Then, the gradient descent technique is used to maximize the loss. D1 , and update the weight of the discriminator D1, the purpose of which is to enable D1 to have the ability to distinguish between the latent space q(z) and the prior distribution p(z);

[0106]

[0107] Among them, z represents the variable that obeys the prior distribution p(z), D1() represents the judgment result of the discriminator D1 on the variable, E represents the expected value of the distribution function, and pd (W) is the data distribution that the data sample W obeys.

[0108] (4.2) Adversarial training is performed on the discriminator D2 and the autoencoder AE, and the sample training set W train The data is passed into the autoencoder AE, and the reconstructed sample W' is finally output. Both the real sample W and the reconstructed sample W' are used as the input of the discriminator D2, and the discriminator D2 is allowed to judge whether the input is the real sample W or the reconstructed sample W'. The judgment result is compared with the real label, and the loss function is calculated according to formula (14). Then, the gradient descent technique is used to maximize the loss. D2 , and update the weight of the discriminator D2, the purpose of which is to enable D2 to have the ability to distinguish between real samples W and reconstructed samples W';

[0109]

[0110] Among them, D2() represents the judgment result of the discriminator D2 on the variable;

[0111] (4.3) Use formula (15) to calculate the real sample W train and reconstructed sample W' train The reconstruction loss MSE train ;

[0112]

[0113] Where MSE represents the mean square error loss, k represents the total number of samples W; then use formula (16) to calculate the loss function of AE:

[0114]

[0115] Use gradient descent technology to minimize Loss as much as possible AE , and update the weights of the autoencoder AE to improve the autoencoder AE's ability to reconstruct samples and strengthen its final detection ability; for the verification set W vali Perform the E2 round of validation test and obtain the average validation set reconstruction loss MSE corresponding to each individual according to formula (15): vali , the population P is calculated g The average validation set reconstruction loss MSE of all individuals in vali , the population P g The lowest MSE vali The corresponding individual is marked as the best individual G in the population 0best ;

[0116] (5) Set the initial number of iterations g = 1;

[0117] (6) The previous generation population P g-1The optimal individual G (g-1)best Replicated into the contemporary population P g middle;

[0118] (7) Perform the selection operation of the bidding competition plan, that is, first use the uniformly distributed probability to select the previous generation population P g-1 Three individuals p a , p b , p c , select p a , p b , p c The two individuals with the highest fitness among the three individuals are selected as parents and marked as p d and p e ;

[0119] (8) Use formula (17) to uniformly generate a random array r1 with the same length as the genetic individual. Each bit r in array r1 is 1d is a random real number between 0 and 1 generated using normal distribution. 1d Determine whether it is less than the pre-set crossover rate β. If so, the parent p d and p e The dth bit of the individual code of p is cross-operated, that is, d and p e The codes of the individuals at position d are exchanged. The two individuals after the crossover are recorded as offspring and are labeled c1 and c2;

[0120] r1={r 11 ,…,r 1d ,…,r 1D},1≤d≤BD,0≤r 1d ≤1 (17)

[0121] Among them, r 11 , r 1d , r 1D Respectively represent the values ​​of the 1st dimension, dth dimension, and BDth dimension in the random array r1.

[0122] (9) Generate two random arrays r2 and r3 with the same length as the genetic individual by uniform distribution, i.e. r2 = {r 21 ,…,r 2d ,…,r 2D},1≤d≤BD,0≤r 2d ≤1, r3={r 31 ,…,r 3d ,…,r 3D},1≤d≤BD,0≤r 3d ≤1. For each bit r in array r2 2dDetermine whether it is less than the pre-set mutation rate σ. If so, the d-th dimension code value in the offspring c1 is inverted. 3d Determine whether it is less than the pre-set mutation rate σ. If so, the offspring c2 is inverted in the d-th dimension encoding value. Finally, add the offspring c1 and c2 to the contemporary population P. g middle;

[0123] (10) Repeat steps (6) to (9) until the contemporary population P g The size reaches the preset population size N;

[0124] (11) According to the performance evaluation process described in step (4), P g Each individual P in g Perform performance evaluation and obtain P g The best individual in the gbest ;

[0125] (12) If g <G max , then update g=g+1 and repeat steps (6) to (11); otherwise, go directly to the next step;

[0126] (13) According to the global optimal individual G finally obtained in the offline optimization training module best The optimal model information represented is used to construct the optimal autoencoder network model in the online detection module of industrial Internet intrusion detection;

[0127] (15) Use the online detection module to run the optimal autoencoder network model and perform the online detection on the dataset W test Perform online intrusion detection and calculate the performance indicators of intrusion detection such as precision, recall, and F1 score according to formulas (18) to (20);

[0128]

[0129]

[0130]

[0131] Among them, TP represents the number of normal industrial Internet data samples correctly predicted as normal, TN represents the number of abnormal industrial Internet data samples correctly predicted as abnormal, FP represents the number of abnormal industrial Internet data samples incorrectly predicted as normal, and FN represents the number of normal industrial Internet data samples incorrectly predicted as abnormal. In this implementation case, the performance indicators obtained by the technology of the present invention are: precision = 0.8356, recall rate = 0.9214, F1 score = 0.8764;

[0132] By comparing and analyzing the experimental results of the above embodiments using the technology of the present invention and the prior art, Figure 5 As shown in the figure, sub-figure (a) compares the recall rate of the present invention with that of existing technologies such as GDN (Graph Neural Network-Based Anomaly Detection in Multivariate Time Series) and USAD (UnSupervised Anomaly Detection on Multivariate Time Series), which rely on manual experience. Sub-figure (b) compares the F1 score of the present invention with those of GDN and USAD. It is not difficult to find that compared with existing technologies such as GDN and USAD, which rely on manual experience, the present invention achieves the best recall rate and F1 score, which are important intrusion detection performance indicators.

[0133] The beneficial effects of this patent are: compared with the existing technology, the present invention can realize the adversarial training of the autoencoder model and the automatic optimization design of the autoencoder model for the application field of industrial Internet intrusion detection, thereby improving the design stability and intelligent design level of the industrial Internet intrusion detection system; it also improves important performance indicators such as the recall rate and F1 score of the industrial Internet system intrusion detection.

Claims

1. An industrial Internet adversarial training unsupervised intrusion detection system based on autoencoder network model optimization, characterized by: The system includes a data decompression module, a data preprocessing module, an autoencoder network model offline optimization module, and an online detection module for industrial Internet intrusion detection; The data decompression module of the industrial Internet intrusion detection system includes two submodules: data acquisition and data cleaning. The main function of the data acquisition module is to collect and summarize the real-time sensor time series data of the industrial Internet system. The main function of the data cleaning module is to use spectral residual technology to clean each data feature in the industrial Internet time series data; the cleaned data set is input into the data preprocessing module. The data preprocessing module includes two submodules: data normalization and data sampling. The data normalization module calculates the extreme value of each dimension in the data set to eliminate the dimension and accelerate the optimization process. The data sampling module divides the long time series data into block data to generate the final data set, which is used as the input of the autoencoder network model optimization module; The autoencoder network model offline optimization module is to binary encode the autoencoder network model based on the final data set generated by the data preprocessing module, and use binary genetic optimization technology in combination with the individual fitness evaluation module to obtain the optimal autoencoder network model architecture and parameter information after iterative optimization; and at the same time input it into the online detection module; The individual fitness evaluation module obtains the encoding information of each individual from the autoencoder network model offline optimization module, constructs an autoencoder AE and two discriminators D1 and D2, and through three-way adversarial training, discriminates the validation set samples according to the reconstruction loss of the autoencoder AE, calculates the validation set F1 score as the fitness value of each individual, and transmits the fitness value of each individual back to the autoencoder network model offline optimization module; After receiving the architecture and parameter information of the optimal autoencoder network model, the online detection module constructs the optimal autoencoder network model, performs anomaly detection on the real-time communication traffic of the industrial Internet, and determines whether the sample is abnormal.

2. An industrial Internet intrusion detection method based on autoencoder network model optimization using the system of claim 1, characterized in that: The following steps are involved: (1) The data decompression module in the industrial Internet intrusion detection system collects and summarizes the real-time sensor time series data of the industrial Internet system, marks the collected data as x, and uses formula (1), formula (2), and formula (3) to perform Fourier transform on the data to obtain a logarithmic amplitude spectrum; A(f)=Amplitude(F(x)) (1) P(f)=Phrase(F(x)) (2) L(f)=Log(A(f)) (3) Where F(x) represents the Fourier transform of x; A(f) is the amplitude spectrum of the input sequence x, P(f) is the phase spectrum of the input sequence x, and L(f) is the logarithmic representation of the amplitude spectrum A(f). Use formulas (4) and (5) to calculate the spectral residual: <h2 style=";text-align:left;direction:ltr">AL(f) = h<h2 style=";text-align:left;direction:ltr"> q <h2 style=";text-align:left;direction:ltr"> (f)·L(f) (4) R(f)=L(f)-AL(f) (5) Where AL(f) is the average spectrum of the logarithmic amplitude spectrum L(f), h q (f) is the convolution operation, R(f) is the spectral residual; the sequence is transformed back to the spatial domain using the inverse Fourier transform using formula (6); S(x)=||F -1 (exp(R(f)+iP(f)))|| (6) Among them F -1 () represents the inverse Fourier transform, and the time series data processed by the data decompression module is marked as S(x), and i represents the imaginary unit; The data preprocessing module in the industrial Internet intrusion detection system performs data normalization processing according to formula (7) after receiving the S(x) data, and marks the data set obtained after the normalization processing as X; Among them, X j Represents the feature of the j-th dimension of the dataset X, S j Represents the feature of the j-th dimension in the source dataset S, S jmax Represents the maximum value of the feature of the j-th dimension of the source dataset S, S jmin represents the minimum value of the feature of the jth dimension of the source data set S, and m represents the maximum dimension value of the data set X; data sampling is to use the time series sliding window to intercept the time series data of a certain period of time according to formula (8) to generate the time series sample Y i , and then collect Y at every interval according to formula (9) i Included in W; Y i ={X i ,...,X i+n ,...,X i+Sw ,1≤n≤s w } (8) Among them, s w Indicates the sliding window length, s s represents the sliding window interval, X i represents the data of all dimensions at time point i in X, M represents the length of the dataset X; the dataset obtained after data sampling is marked as W; the training set is marked as W train , the validation set is labeled W vali , the test set is labeled W test ; (2) Setting the parameter values ​​of the offline optimization training module based on the autoencoder network model optimization, the parameter values ​​include the population size N, the autoencoder network model architecture and the number of iterative optimizations G for hyperparameter optimization max , the number of rounds E of autoencoder network model training, the latent space dimension LD of the autoencoder network model, the crossover rate β and the mutation rate σ in the binary genetic optimization solver; (3) Randomly generate an initial population P0 consisting of N individuals, that is, P0 = {p1,…,p i ,…,p N ,1≤i≤N}, where p i represents the i-th individual in P0, p i Encode the hyperparameters and network architecture parameters of the autoencoder network model to be optimized into a BD-dimensional binary vector, p i The specific encoding of the position is shown in formula (10): p i ={b1,…,b d ,…,b D },1≤d≤BD (10) Among them, b d Represents the d-th binary value of the hyperparameters and network architecture parameters of the autoencoder network model, b d ∈{0,1}, and p i The hyperparameters and network architecture parameters of the autoencoder network model corresponding to the position are marked as q i , that is, q i The real number vector representing the hyperparameters of the autoencoder network model and the network architecture parameters corresponding to the i-th individual is composed as shown in formula (11): Among them, [B, f, η] represents the hyperparameters used by the autoencoder network model, B represents the batch size used in the training of the autoencoder network model, f represents the type of optimizer used in the training of the autoencoder network model, f∈{adamax,adam,rmsprop,adadelta}, adamax represents Adaptive Moment Estimation Max optimization (Adamax), adam represents Adaptive Moment Estimation, rmsprop represents Root Mean Square Propogation, and adadelta represents the optimization solution method of accumulating the weighted sum of the differences between two adjacent iterations (i.e., iterative increments) based on the root mean square back propagation; η represents the learning rate used in the training of the autoencoder network model; L n Represents the number of convolutional layers in the autoencoder network model, layer j Represents the j-th convolutional layer, 1≤j≤n c , layer j The specific composition of is shown in formula (12): layer j =[oc j ,ks j ,nt j ,of j ], 1≤j≤L n (12) Among them, oc j Represents the number of convolution kernels in the jth convolution layer, ks j Represents the convolution kernel size of the j-th convolution layer, nt j Represents the normalization layer type connected to the j-th convolutional layer, nt j ∈{batchnorm,none}, batchnorm stands for batch normalization, none means no processing, af j Represents the activation function type of the j-th convolutional layer, af j ∈{sigmoid,tanh,relu,none}, sigmoid represents the S-type function, tanh represents the hyperbolic tangent function, and relu represents the linear rectification function; (4) The performance evaluation of the population P0 is performed as follows: the hyperparameters and network architecture real numbers q represented by each individual in P0 are i Converted into the corresponding autoencoder network model AE, that is, using q i layer j The relevant convolutional layer parameters are constructed layer by layer to form the encoder AE E , and use the same parameter mirror to construct the deconvolution layer to form the decoder AE D ; At the same time, use the pre-set discriminator network architecture parameters to build discriminators D1 and D2, and train the training data set W train As the data input of each autoencoder network model, E rounds of offline adversarial training are performed. The specific steps are as follows: (4.1) For the discriminator D1 and encoder AE E Conduct adversarial training, sample training set W train Passed into the autoencoder AE, the encoder AE E Generate a sample latent space q(z); take the latent space q(z) and the prior distribution p(z) as the input of the discriminator D1, and let D1 judge whether the input is the prior distribution p(z) or the sample latent space q(z); compare the judgment result with the true label, and calculate the loss function according to formula (13), and then use the gradient descent technique to maximize the Loss D1 , and update the weight of the discriminator D1, the purpose of which is to enable D1 to have the ability to distinguish between the latent space q(z) and the prior distribution p(z); Among them, z represents the variable that obeys the prior distribution p(z), D1() represents the judgment result of the discriminator D1 on the variable, E represents the expected value of the distribution function, and p d (W) is the data distribution obeyed by the data sample W; (4.2) Adversarial training is performed on the discriminator D2 and the autoencoder AE, and the sample training set W train The data is passed into the autoencoder AE, and the reconstructed sample W' is finally output. Both the real sample W and the reconstructed sample W' are used as the input of the discriminator D2, and the discriminator D2 is allowed to judge whether the input is the real sample W or the reconstructed sample W'; the judgment result is compared with the real label, and the loss function is calculated according to formula (14), and then the gradient descent technology is used to maximize the loss. D2 , and update the weight of the discriminator D2, the purpose of which is to enable D2 to have the ability to distinguish between real samples W and reconstructed samples W'; Among them, D2() represents the judgment result of the discriminator D2 on the variable; (4.3) Use formula (15) to calculate the real sample W train and reconstructed sample W' train The reconstruction loss MSE train ; Where MSE represents the mean square error loss, k represents the total number of samples W; then use formula (16) to calculate the loss function of AE: Use gradient descent technology to minimize Loss as much as possible AE , and update the weights of the autoencoder AE to improve the autoencoder AE's ability to reconstruct samples and strengthen its final detection ability; for the verification set W vali Perform the E2 round of validation test and obtain the average validation set reconstruction loss MSE corresponding to each individual according to formula (15): vali , the population P is calculated g The average validation set reconstruction loss MSE of all individuals in vali , the population P g The lowest MSE vali The corresponding individual is marked as the best individual G in the population 0best ; (5) Set the initial number of iterations g = 1; (6) The previous generation population P g-1 The optimal individual G (g-1)best Replicated into the contemporary population P g middle; (7) Perform the selection operation of the bidding competition plan, that is, first use the uniformly distributed probability to select the previous generation population P g-1 Three individuals p a , p b , p c , select p a , p b , p c The two individuals with the highest fitness among the three individuals are selected as parents and marked as p d and p e ; (8) Use formula (17) to uniformly generate a random array r1 with the same length as the genetic individual. Each bit r in array r1 is 1d is a random real number from 0 to 1 generated using normal distribution; for each bit r of array r1 1d Determine whether it is less than the pre-set crossover rate β. If so, the parent p d and p e The dth bit of the individual code of p is cross-operated, that is, d and p e The codes of the individuals at position d are exchanged; the two individuals after the crossover are recorded as offspring and are marked as c1 and c2; r1={r 11 ,…,r 1d ,…,r 1D },1≤d≤BD,0≤r 1d ≤1 (17) Among them, r 11 , r 1d , r 1D Respectively represent the values ​​of the 1st dimension, dth dimension, and BDth dimension in the random array r1; (9) Generate two random arrays r2 and r3 with the same length as the genetic individual by uniform distribution, i.e. r2 = {r 21 ,…,r 2d ,…,r 2D },1≤d≤BD,0≤r 2d ≤1, r3={r 31 ,…,r 3d ,…,r 3D },1≤d≤BD,0≤r 3d ≤1; for each bit r in array r2 2d Determine whether it is less than the pre-set mutation rate σ. If so, the d-th dimension code value in the offspring c1 is inverted; for each r in the number string r3 3d Determine whether it is less than the pre-set mutation rate σ. If so, the offspring c2 is inverted in the d-th dimension encoding value; finally, the offspring c1 and c2 are added to the contemporary population P. g middle; (10) Repeat steps (6) to (9) until the contemporary population P g The size reaches the preset population size N; (11) According to the performance evaluation process described in step (4), P g Each individual P in g Perform performance evaluation and obtain P g The best individual in the gbest ; (12) If g <G max , then update g=g+1 and repeat steps (6) to (11); otherwise, go directly to the next step; (13) According to the global optimal individual G finally obtained in the offline optimization training module best The optimal model information represented is used to construct the optimal autoencoder network model in the online detection module of industrial Internet intrusion detection; (15) Use the online detection module to run the optimal autoencoder network model and perform the online detection on the dataset W test Perform online intrusion detection and calculate the precision, recall, and F1 score performance indicators of intrusion detection according to formulas (18) to (20); Among them, TP represents the number of normal industrial Internet data samples correctly predicted as normal classification, TN represents the number of abnormal industrial Internet data samples correctly predicted as abnormal classification, FP represents the number of abnormal industrial Internet data samples incorrectly predicted as normal classification, and FN represents the number of normal industrial Internet data samples incorrectly predicted as abnormal classification.

Citation Information

Patent Citations

  • Intrusion detection method based on CVAE-GAN

    CN110113353A

  • Gaussian autoencoder detection of network flow anomalies

    US20200106805A1