A network anomaly intrusion detection model training method, detection method and device

By constructing a training data set and optimizing the deep reinforcement learning model on the autonomous domain client, combined with federated learning and differential privacy algorithms, the problems of low detection accuracy and data privacy leakage in network anomaly intrusion detection are solved, and efficient network anomaly intrusion is achieved. detection.

CN118018426BActive Publication Date: 2024-10-01ZHONGKE LIANAN (NANJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410101700.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-10-01
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

Existing network anomaly intrusion detection technology has problems such as low detection accuracy, difficulty in obtaining real training data sets, overestimation of the Q value in deep reinforcement learning, and the risk of data privacy leakage in federated learning.

Method used

Construct training data sets on each autonomous domain client, build a Markov decision process, optimize the initial deep reinforcement learning model, use double Q learning network and competitive network structure, learn through experience playback, combine with federated learning for model aggregation, and perform model aggregation on the data Gaussian noise is added to the transmission using a differential privacy algorithm.

Benefits of technology

It improves the accuracy of network anomaly intrusion detection, solves the problem of Q value overestimation, accelerates model convergence, and achieves a balanced data sharing calculation without leaking data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118018426B_ABST
    Figure CN118018426B_ABST
Patent Text Reader

Abstract

The present invention provides a network anomaly intrusion detection model training method, detection method and device, including: constructing a training data set for each autonomous domain client; constructing a Markov decision process, and setting a state space, an action space and a reward function; obtaining an initial deep reinforcement learning model, and using a double Q learning network and a competitive network structure to optimize the network structure, and constructing an initial detection model; setting an initial experience replay pool, and learning from past classification experience by experience replay; using the training data set to train the initial detection model, and obtaining a local detection model for each autonomous domain client; uploading the local detection models obtained by each training to a central server for aggregation, and receiving the aggregated updated model for a new round of federated training, repeating the training until the preset performance index is reached, and obtaining a global detection model. The method provided by the present invention has high detection accuracy and ensures data privacy security during the training process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a network anomaly intrusion detection model training method, a detection method and a device. Background Art

[0002] With the continuous development of science and technology, network technology has become an indispensable part of people's lives. It has changed people's lifestyles and made life more and more intelligent. While bringing convenience and innovation, network security must also be taken seriously, because this development has caused some illegal intruders to pose a threat to network security. For example, intruders may steal user information, spread Trojan viruses, etc.

[0003] As a relatively effective means of protection in the field of network security, network anomaly detection technology can timely and accurately identify abnormal traffic in the network environment, accurately obtain and identify abnormal intrusion attacks in the network environment, and then trigger the system's protection function and respond, thereby ensuring that the network environment is not infringed.

[0004] Since the development of network anomaly intrusion detection technology, many important research results have been achieved. At present, the research of domestic and foreign researchers on network anomaly intrusion detection mainly focuses on two technical means: machine learning and deep learning. With the continuous deepening of research, some scholars have combined deep learning with reinforcement learning methods, bringing new ideas to the research of network anomaly intrusion detection.

[0005] However, when dealing with network anomaly intrusion detection problems, these existing algorithms have limitations to varying degrees:

[0006] 1. Traditional network anomaly intrusion algorithms, such as feature-based and statistics-based detection methods, mainly detect and identify responses through some predefined rules or establish relevant statistical models. However, traditional network anomaly intrusion detection methods cannot meet the increasingly rich types of network anomalies and have low detection accuracy.

[0007] Second, the network anomaly intrusion algorithm based on traditional machine learning is often trained based on a specific data set to obtain a prediction model, and then schedule tasks according to the prediction results of the model. However, in real-world anomaly intrusion detection scenarios, there is often no pre-prepared historical data for training.

[0008] 3. Network anomaly intrusion detection algorithms based on traditional reinforcement learning, such as Q-learning, SARSA and other algorithms, need to maintain a Q-table data structure. This leads to problems such as memory exhaustion and difficulty in converging the Q-table when the problem scale is large.

[0009] 4. Network anomaly intrusion detection algorithm based on deep reinforcement learning can overcome the limitations of traditional reinforcement learning Q table, but deep reinforcement learning algorithm often has the problem of overestimation of Q value, and estimates a specific action value for each action, which may lead to unnecessary calculations in some cases.

[0010] 5. The network anomaly intrusion detection algorithm based on federated learning coordinates multiple sub-servers through a central server, and conducts distributed machine learning without infringing any information in the local data sets of the participants, thereby establishing a common model for the benefit of all participants. However, the aggregation algorithm effect of federated learning needs to be optimized, and the privacy security of model data can still be stolen through some inference attacks during the model transmission process. Summary of the invention

[0011] In view of this, the embodiments of the present invention provide a network anomaly intrusion detection model training method, a detection method and a device to eliminate or improve one or more defects existing in the prior art, and solve the problems of low detection accuracy, difficulty in obtaining real training data sets, over-estimation of Q values ​​in deep reinforcement learning, and risk of data privacy leakage in federated learning in existing network anomaly intrusion detection schemes.

[0012] On the one hand, the present invention provides a network anomaly intrusion detection model training method, the method is executed on each autonomous domain client, and the method includes the following steps:

[0013] Constructing a training data set for each autonomous domain client, wherein the training data set includes multiple samples, each sample being a piece of network traffic data;

[0014] Constructing a Markov decision process, constructing a state space according to the network flow data in the training data set, constructing an action space according to classifying each network flow data, and setting a reward function according to the classification accuracy;

[0015] Obtaining an initial deep reinforcement learning model, and optimizing the network structure of the initial deep reinforcement learning model using a double Q learning network and a competitive network structure to construct an initial detection model;

[0016] An initial experience replay pool is set to learn from past classification experience by experience replay; the initial detection model is trained using the training data set to obtain a local detection model of each autonomous domain client;

[0017] Each autonomous domain client uploads its trained local detection model to the central server for aggregation, and receives the aggregated updated model for a new round of federated training, repeating the federated training steps until the preset performance indicators are reached to obtain a global detection model.

[0018] In some embodiments of the present invention, optimizing the network structure of the initial deep reinforcement learning model further includes:

[0019] The multilayer perceptron in the initial deep reinforcement learning model is replaced with a combination of a one-dimensional convolutional neural network and a bidirectional long short-term memory neural network to learn and extract features from past and future time steps of the network traffic data, respectively.

[0020] In some embodiments of the present invention, learning from past classification experience by experience playback also includes:

[0021] In deep reinforcement learning, an estimated value is obtained based on an estimation function, and a difference between the estimated value and a target value is calculated;

[0022] The difference is used as a measurement indicator of the experience replay priority, and a quadruple with a large difference has a higher priority to perform more training; the quadruple includes the state, action, reward value at the current moment, and the state at the next moment.

[0023] In some embodiments of the present invention, each autonomous domain client uploads its trained local detection model to a central server for aggregation, further comprising:

[0024] Calculate the classification accuracy of the local detection model of each autonomous domain client, and use the classification accuracy as a weight factor;

[0025] In the central server, the local detection models of the clients in each autonomous domain are aggregated according to the weight factors.

[0026] In some embodiments of the present invention, the local training of the federated training further includes:

[0027] Each autonomous domain client updates the model parameters by calculating the gradient of the loss function to the parameters, where the loss function is obtained by subtracting the value of the prediction function from the value of the objective function;

[0028] A regularization term is introduced to add a penalty term to the objective function to improve the generalization ability of the model.

[0029] In some embodiments of the present invention, when each autonomous domain client uploads its trained local detection model to the central server, a differential privacy algorithm is used to add Gaussian noise to the uploaded local detection model parameters to reduce the probability of data leakage.

[0030] In some embodiments of the present invention, the method further comprises:

[0031] In deep reinforcement learning, each agent uses the Epslion-Greedy strategy to make action decisions based on its current state.

[0032] In another aspect, the present invention provides a method for detecting abnormal network intrusion, the method comprising the following steps:

[0033] Obtain the network traffic data to be detected;

[0034] The network traffic data is input into a global detection model trained based on any one of the network anomaly intrusion detection model training methods mentioned above to obtain a classification result of the network traffic data.

[0035] In another aspect, the present invention provides a network abnormal intrusion detection device, the device comprising:

[0036] An input module, used for acquiring network traffic data to be detected and inputting the network traffic data into a processing module;

[0037] A processing module, comprising a global detection model trained based on any one of the network anomaly intrusion detection model training methods mentioned above, for classifying the network traffic data;

[0038] The output module is used to output the classification result of the network traffic data.

[0039] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods mentioned above.

[0040] The beneficial effects of the present invention are at least:

[0041] The present invention provides a network anomaly intrusion detection model training method, a detection method and a device, comprising: constructing a training data set for each autonomous domain client; constructing a Markov decision process, and setting a state space, an action space and a reward function; obtaining an initial deep reinforcement learning model, and using a double Q learning network and a competitive network structure to optimize the network structure, and constructing an initial detection model; setting an initial experience replay pool, and learning from past classification experience by way of experience replay; using the training data set to train the initial detection model, and obtaining a local detection model for each autonomous domain client; uploading the local detection models obtained by each training to a central server for aggregation, and receiving the aggregated and updated model for a new round of federated training, and repeating the training until the preset performance index is reached, and a global detection model is obtained. The present invention optimizes the structure of the original DQN model, corrects the action decision of the deep reinforcement learning agent, solves the problem of over-estimation of Q value, promotes the agent's exploration of the environment, accelerates model convergence, and obtains a more stable network anomaly intrusion detection model; at the same time, by using the distributed machine learning method of federated learning, without the need to exchange local individual or sample data, a global model based on virtual fusion data is constructed by only exchanging model parameters or intermediate results, thereby achieving a balance between data privacy protection and data sharing calculation; further, aggregation weights are designed in federated learning, and Gaussian noise is added to the transmission data, which greatly reduces the probability of data leakage; thus, the network anomaly intrusion detection model trained based on the training method provided by the present invention has an extremely high detection accuracy.

[0042] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0043] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0045] Figure 1 The figure is a schematic diagram of the steps of a network anomaly intrusion detection model training method in one embodiment of the present invention.

[0046] Figure 2The figure is a flow chart of a method for training a network anomaly intrusion detection model in one embodiment of the present invention.

[0047] Figure 3 Schematic diagram of the optimized detection model structure in one embodiment of the present invention.

[0048] Figure 4 Schematic diagram of the intelligent agent detection process based on the optimized detection model in one embodiment of the present invention.

[0049] Figure 5 Schematic diagram of a federated learning framework in one embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0051] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0052] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0053] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0054] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0055] It should be emphasized here that the step marks mentioned below are not intended to limit the order of the steps, but it should be understood that the steps can be executed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be executed simultaneously.

[0056] In order to solve the problems of low detection accuracy, difficulty in obtaining real training data sets, over-estimation of Q values ​​in deep reinforcement learning, and data privacy leakage risks in federated learning in existing network anomaly intrusion detection solutions, the present invention proposes a network anomaly intrusion detection model training method, which is executed on each autonomous domain client, such as Figure 1 As shown, the method includes the following steps S101 to S105:

[0057] Step S101: construct a training data set for each autonomous domain client, wherein the training data set includes multiple samples, each sample being a piece of network traffic data.

[0058] Step S102: construct a Markov decision process (MDP), construct a state space according to the network traffic data in the training data set, construct an action space according to the classification of each network traffic data, and set a reward function according to the classification accuracy.

[0059] Step S103: Obtain an initial deep reinforcement learning model, and use a double Q learning network and a competitive network structure to optimize the network structure of the initial deep reinforcement learning model to construct an initial detection model.

[0060] Step S104: setting an initial experience replay pool, learning from past classification experience by means of experience replay; using the training data set to train the initial detection model, and obtaining a local detection model for each autonomous domain client.

[0061] Step S105: Each autonomous domain client uploads its trained local detection model to the central server for aggregation, and receives the aggregated updated model for a new round of federated training, repeating the federated training steps until the preset performance indicators are reached to obtain a global detection model.

[0062] like Figure 2 The figure shows a flow chart of the overall technical solution for the network anomaly intrusion detection model training method.

[0063] In step S101, a training data set for each autonomous domain client is first constructed to simulate network traffic data in a real network scenario for training a deep reinforcement learning agent.

[0064] In step S102, the problem of network anomaly intrusion detection is modeled as a Markov decision process, a Markov decision process quaternary (S, A, R, S′) is designed, and the state space S, action space A, and reward function R in the quaternary are defined, where S′ represents the state space at the next moment.

[0065] State space: The state space is the set of all states. In the present invention, the state space is constructed according to the network traffic data in the training data set, as shown in formula (1):

[0066] S={s1,s2,s3,...,s τ}; (1)

[0067] For any specific state si in the state space, state si is a piece of network traffic data selected from the training data set.

[0068] Action space: The action space is the set of all actions that a deep reinforcement learning agent can take. In the present invention, the action space is constructed by classifying each network traffic data, as shown in formula (2):

[0069] A={a1,a2,a3,...,a χ}; (2)

[0070] For any specific action a in the action space i , action a i Indicates a classification. Specifically, in state s i Select action a i , which means that the network traffic data s i Classified as network anomaly type a i .

[0071] Reward function: The reward function is used to calculate the reward in state s i Select action a i After that, the deep reinforcement learning agent gets the reward value. The agent will calculate a corresponding reward value for each action and select the action with the largest reward value as the final action to be executed.

[0072] In some embodiments, for the network anomaly intrusion detection problem studied by the present invention, a reward function is set according to the performance evaluation index of the network anomaly intrusion detection, wherein the performance evaluation index may include classification accuracy, precision, recall rate, etc., so that the convergence target of deep reinforcement learning moves towards the direction of maximum performance. Exemplarily, the reward return is set according to whether the intelligent agent can correctly classify the sample (network traffic data). When the classification is correct, a reward return of +1 is given, and when the classification is wrong, a reward return of -1 is given.

[0073] In step S103, a deep reinforcement learning model is constructed.

[0074] Get the initial deep reinforcement learning model, which means using the original deep Q-network (Deep Q-Network, DQN) and initializing the network parameters. Deep Q-network, or DQN, is a multi-layer neural network and a typical deep reinforcement learning algorithm. The idea of ​​the algorithm design is to use a deep neural network to parameterize the action-state function Q so as to maximize the long-term expected cumulative discounted return and obtain the best action. The specific process is to let the agent seek the best strategy for sequential decision-making problems by optimizing the accumulated future reward signals, and obtain more rewards than other strategies.

[0075] In this invention, considering the defects of the original DQN such as over-estimation of Q value and single model structure, the network structure of DQN is optimized and improved by using double Q-learning network and dueling network structure. Specifically:

[0076] Introducing the Double Q Learning Network (Double DQN): In the traditional DQN algorithm, a neural network is used to estimate the action value function (Q value function), and then the decision is made by selecting the action with the highest Q value. However, since the same network is used for both action selection and Q value estimation, it may lead to an overestimation of the Q value, especially when faced with different action choices. Double DQN solves this problem by introducing two neural networks, one called the "Online Network" for action selection and the other called the "Target Network" for Q value estimation, decoupling action selection and Q value estimation, thereby improving the bias problem in the traditional DQN algorithm. This improvement makes Double DQN more accurate and stable when handling reinforcement learning tasks.

[0077] Introducing the competitive network structure (Dueling DQN): Dueling DQN can decompose the action value function into the state value function and the advantage function, separate the evaluation of the action from the evaluation of the state, and improve the efficiency and stability of the algorithm. At the same time, Dueling DQN shares part of the network structure, namely the feature extraction layer, which is used to learn the state representation. This can reduce the number of network parameters and improve the training efficiency and generalization ability of the model.

[0078] In some embodiments, the variance may be reduced by subtracting the mean of the advantage function to reduce the high variance problem in the value function estimate.

[0079] In some embodiments, based on the optimization based on Double Q-learning and Dueling Network Structures, considering that network traffic data is a time step sequence with spatial and temporal characteristics, and convolutional neural networks (CNN) and long short-term memory networks (LSTM) have their unique advantages in data feature extraction, the network structure of the original DQN is optimized to a combination of convolutional neural networks and long short-term memory networks, so that a more stable policy function can be learned, thereby increasing the accuracy and stability of the entire model.

[0080] Specifically, Figure 3As shown in the figure, the multilayer perceptron of the original DQN is replaced with a combination of a one-dimensional convolutional neural network and a bidirectional long short-term memory neural network to achieve a better network structure. Among them, the bidirectional long short-term memory (BiLSTM) is a bidirectional recurrent neural network (BRNN) architecture that combines the ideas of LSTM and bidirectionality. Unlike traditional LSTM, which can only learn and predict future information from past information, BiLSTM utilizes both past and future information. Specifically, BiLSTM uses two LSTM units at each time step to learn and extract features from past and future time steps respectively. This bidirectionality enables BiLSTM to better capture long-term dependencies and complex relationships in sequence data.

[0081] In step S104, based on the Markov decision process of step S102 and the optimized DQN model of step S103, a network anomaly intrusion detection agent based on deep reinforcement learning is designed, and the agent includes an action decision unit, a reward calculation unit and a parameter update unit. Figure 4 As shown, it is the intelligent agent detection flow chart based on the detection model after network structure optimization.

[0082] Set the initial experience replay pool, that is, set the capacity of the experience replay pool and initialize it. After initializing the network parameters, the agent learns from past classification experience through experience replay.

[0083] In some embodiments, the experience replay pool is improved to a priority-based experience replay pool. Specifically, an estimated value is obtained based on the estimation function Q, and the difference (TD-error) between the estimated value and the target value is calculated; the difference is used as a metric for the experience replay priority, and a quadruple with a large difference has a higher priority to perform more training.

[0084] Through experience replay, the intelligent agent can learn from past experience and break the correlation between samples, making the learning process smoother and preventing parameter oscillation and parameter divergence in the learning process. By designing the priority of data in the replay pool, the effective use of samples can be improved, the learning results of important experiences can be enhanced, and the model can be more focused on data with more learning value, which helps to improve the training efficiency of the model.

[0085] The training data set is then used to train the initial detection model to obtain a trained local detection model for each autonomous domain client.

[0086] In step S105, federated learning is introduced. Federated learning is a distributed machine learning algorithm framework in which multiple clients collaborate to solve machine learning problems under the coordination of a central server. The original private data set of each client (in the present invention, the training data set of each client) is stored locally without exchange or transmission. The federated learning training process achieves the final learning goal by updating the aggregate model parameters. By combining the federated learning technology with the deep reinforcement learning method, the collaborative training of the deep reinforcement learning subject can be achieved.

[0087] During the training process, local training is first performed locally on each autonomous domain client to obtain a local detection model. The trained local detection model gradient-related parameters are uploaded to the central server for aggregation and update to obtain a global model. The central server then sends the global model gradient-related parameters to each autonomous domain client. Each autonomous domain client updates the local model to start the next round of federated learning training. The above federated training steps are repeated until the preset performance indicators are reached and the global detection model is obtained.

[0088] By using the above-mentioned collaborative training method for clients in each autonomous domain, the combination of federated learning and deep reinforcement learning can provide more comprehensive training samples for the training of clients based on deep reinforcement learning, and train a more accurate and stable network anomaly intrusion detection model. In addition, each client can be trained in parallel to improve training efficiency, promote the model training process, and increase the convergence speed of the global model.

[0089] In some embodiments, the aggregation algorithm in federated learning is improved. In the original FedAvg method, all local model (local model of each autonomous domain client) updates are considered to be equally important, which may lead to poor quality of some local models, thereby affecting the quality of the global model. Therefore, in the present invention, when aggregating local models, the classification accuracy of each local model is first calculated, and the classification accuracy is used as a weight factor. During the aggregation process, the accuracy of each local model is used as the weight distribution size to reduce the weight of the local model with poor quality, thereby ensuring the quality of the model and ensuring that the local model will not reduce the quality of the global model, as shown in formula (3):

[0090]

[0091] Among them, w t+1 represents the aggregated global model parameters; n represents the size of the local data (training data set) of all autonomous domain clients; n c Indicates the local data size of the client in the cth autonomous domain; represents the accuracy of the client in the cth autonomous domain; Represents the local model parameters of the cth autonomous domain client.

[0092] In some embodiments, the local training used by each autonomous domain client in the FedAvg algorithm adopts the gradient descent method, that is, each autonomous domain client updates the model parameters by calculating the gradient of the loss function to the parameters. The loss function is obtained by subtracting the value of the prediction function from the value of the objective function. In the present invention, regularization term optimization is added to the local training of each autonomous domain client, that is, a penalty term is added to the objective function to reduce the deviation of the local model and improve the generalization ability of the model.

[0093] In some embodiments, when each autonomous domain client uploads its trained local detection model to the central server, data such as gradient information is easily leaked, and data privacy is at risk. Therefore, the differential privacy mechanism is introduced in the present invention to ensure security, and Gaussian noise is added to the uploaded local detection model parameters using a differential privacy algorithm to protect user privacy.

[0094] Differential privacy is a randomized algorithm M: D→R(∈,δ), where D represents the original data set and R represents the value range of the output result. The algorithm satisfies the following conditions: for any two data sets D and D′ that differ by only one record, and any output result S(S∈R), the condition holds, as shown in formula (4):

[0095] Pr[M(D)∈S]≤e ∈ Pr[M(D′)∈S]+δ; (4)

[0096] Where M represents a random algorithm; D and D′ are any two data sets that differ by only one record; S represents the output result; ∈ represents the degree of privacy protection. The smaller the value of ∈, the more consistent the two probability values ​​are, that is, the existence of a single record does not affect the output result, resulting in better privacy and a higher degree of privacy protection; δ represents the relaxation factor.

[0097] Then calculate the function sensitivity. The function sensitivity definition for any function f is shown in formula (5):

[0098] Δf=max D,D′ ‖f(D)-f(D′)‖2; (5)

[0099] Where D and D′ are any two data sets that differ by only one record.

[0100] Gaussian mechanism differential privacy protection is a mechanism that estimates the real-valued function f:D→R by adding Gaussian noise calibrated with sensitivity Δf. The Gaussian noise mechanism is defined as shown in formula (6):

[0101]

[0102] in, is a mean of 0 and satisfies The variance is σ 2 Normal Gaussian distribution.

[0103] Based on the above description, the training process of federated learning is as follows Figure 5 shown.

[0104] In addition to the collaborative training of deep reinforcement learning models, this method also solves the information security and data privacy issues of autonomous domain clients. During the training of the federated model, any privacy information such as data and models provided by each autonomous domain client to the central server will be subjected to differential privacy algorithm to add Gaussian noise, greatly reducing the possibility of data privacy leakage.

[0105] In some embodiments, after step S105, the method further includes:

[0106] When constructing the training data set, a test set is also constructed, where the test set also consists of multiple network traffic data. The test set is input into the trained global detection model to obtain the corresponding classification results to test the performance of the model.

[0107] The present invention is further described below in conjunction with a specific embodiment.

[0108] Construct a training data set for each autonomous domain client and configure the environment. This embodiment uses two classic network anomaly intrusion detection data sets, NSL-KDD data set and UNSW-NB15, to construct a training data set.

[0109] After constructing the Markov decision process and the initial detection model according to the above description of step S102 and step S103, a deep reinforcement learning agent is designed to solve the problem of network anomaly intrusion detection.

[0110] When the agent is initialized, an experience replay pool will be created and the capacity of the replay pool will be specified. In this embodiment, the size of the experience replay pool is 1000. The experience replay pool stores the detection results of past abnormal network traffic data, including the state of each network traffic data, the actions taken for each network traffic data state, the immediate reward obtained after each action is executed, and the next state after completion. After each detection is completed, the agent will randomly extract some samples from the experience replay pool for learning, and update the model parameters through back propagation. The purpose of random extraction is to cancel the correlation between samples, make the learning process more stable, and accelerate the convergence of the model. This process can be referred to Figure 4 .

[0111] The agent is based on the current state s iThe Epslion-Greedy strategy is used for action decision making, as shown in formula (7):

[0112]

[0113] Among them, the value of ∈ decreases with the increase of training times until ∈ min .

[0114] Through the Epslion-Greedy strategy, in the early stage of training, the intelligent body will adopt more random methods to select actions, so as to achieve the exploration of the state space. In the later stage of training, the intelligent body will adopt more actions predicted by the Q-network, and use the model to continuously learn from past experience to finally obtain a better and more stable scheduling strategy.

[0115] When the agent predicts the next action through the Q-network, it needs to calculate the Q value corresponding to each action, and then select the one with the largest Q value as the final decision action. The Q value calculation formula for the action taken at time t is shown in formula (8):

[0116]

[0117] Among them, Q evaluation represents the predicted Q value predicted by the Q-network; Q target Indicates the actual Q value; s t and a t They represent the state and action at time t respectively.

[0118] The Double Q-learning algorithm is used to calculate the actual Q value, which solves the Q value overestimation problem of the original Q-learning algorithm, as shown in formulas (9) and (10):

[0119] Q evaluation (s t ,a t )=Q t (s t ,a t ); (9)

[0120]

[0121] Among them, γ represents the decay factor of future rewards; θ t represents the network parameters of the online network; θ′ t represents the network parameters of the fixed network; r t represents the immediate reward at time t; the annotations of other variables refer to formula (8).

[0122] The trained deep reinforcement learning model is used as the local training model of each autonomous domain client in the federated learning algorithm. 10 clients are set up, and 5 clients are randomly selected for training each time the federated learning training is performed.

[0123] First, each autonomous domain client uses the local training data set to train the model. Each autonomous domain client uses differential privacy to add perturbed model parameters and uploads the gradient-related parameters of the trained local detection model to the central server. The central server determines the aggregation weight based on the accuracy of each local detection model, aggregates the local models, and updates the global model. The central server sends the new global model to each autonomous domain client, and each autonomous domain client updates the local model and starts the next round of joint learning training until the overall model converges to the optimal.

[0124] On the other hand, the present invention also provides a network abnormal intrusion detection method, which includes the following steps S201-S202:

[0125] Step S201: Acquire network traffic data to be detected.

[0126] Step S202: input the network traffic data into the global detection model trained based on the above-mentioned network anomaly intrusion detection model training method to obtain the network traffic data classification.

[0127] On the other hand, the present invention provides a network abnormal intrusion detection device, the device comprising:

[0128] The input module is used to obtain the network flow data to be detected and input the network flow data into the processing module.

[0129] The processing module includes a global detection model trained based on the above-mentioned network anomaly intrusion detection model training method, which is used to classify network traffic data.

[0130] The output module is used to output the classification results of network traffic data.

[0131] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the program implements the steps of a network anomaly intrusion detection model training method and a network anomaly intrusion detection method.

[0132] Corresponding to the above method, the present invention also provides a device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the method described above.

[0133] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0134] In summary, the present invention provides a network anomaly intrusion detection model training method, a detection method and a device, including: constructing a training data set for each autonomous domain client; constructing a Markov decision process, and setting a state space, an action space and a reward function; obtaining an initial deep reinforcement learning model, and using a double Q learning network and a competitive network structure to optimize the network structure, and constructing an initial detection model; setting an initial experience replay pool, and learning from past classification experience by experience replay; using the training data set to train the initial detection model to obtain a local detection model for each autonomous domain client; uploading the local detection models obtained by each training to a central server for aggregation, and receiving the aggregated updated model for a new round of federated training, and repeating the training until the preset performance index is reached to obtain a global detection model. The present invention optimizes the structure of the original DQN model, corrects the action decision of the deep reinforcement learning agent, solves the problem of over-estimation of Q value, promotes the agent's exploration of the environment, accelerates model convergence, and obtains a more stable network anomaly intrusion detection model; at the same time, by using the distributed machine learning method of federated learning, without the need to exchange local individual or sample data, a global model based on virtual fusion data is constructed by only exchanging model parameters or intermediate results, thereby achieving a balance between data privacy protection and data sharing calculation; further, aggregation weights are designed in federated learning, and Gaussian noise is added to the transmission data, which greatly reduces the probability of data leakage; thus, the network anomaly intrusion detection model trained based on the training method provided by the present invention has an extremely high detection accuracy.

[0135] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0136] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0137] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0138] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A network anomaly intrusion detection model training method, It is characterized in that The method is executed on each autonomous domain client, and the method includes the following steps: Constructing a training data set for each autonomous domain client, wherein the training data set includes multiple samples, each sample being a piece of network traffic data; Constructing a Markov decision process, constructing a state space according to the network flow data in the training data set, constructing an action space according to classifying each network flow data, and setting a reward function according to the classification accuracy; Obtaining an initial deep reinforcement learning model, and optimizing the network structure of the initial deep reinforcement learning model using a double Q learning network and a competitive network structure, replacing the multilayer perceptron in the initial deep reinforcement learning model with a combination of a one-dimensional convolutional neural network and a bidirectional long short-term memory neural network to construct an initial detection model; An initial experience replay pool is set, and learning is performed from past classification experience by experience replay, and an estimated value is obtained based on an estimation function, and the difference between the estimated value and the target value is calculated; the difference is used as a metric of the experience replay priority, and a quadruple with a large difference has a higher priority so as to perform more training; the quadruple includes the current state, action, reward value, and state at the next moment; the initial detection model is trained using the training data set to obtain a local detection model of each autonomous domain client; Calculate the classification accuracy of the local detection model of each autonomous domain client, and use the classification accuracy as a weight factor; upload the trained local detection models to the central server, aggregate them according to the weight factor, receive the aggregated and updated models for a new round of federated training, and repeat the federated training steps until the preset performance indicators are reached to obtain a global detection model, wherein the uploaded local detection model parameters are added with Gaussian noise using a differential privacy algorithm to reduce the chance of data leakage.

2. The network anomaly intrusion detection model training method according to claim 1, It is characterized in that In the local training of the federated training, it also includes: Each autonomous domain client updates the model parameters by calculating the gradient of the loss function to the parameters, where the loss function is obtained by subtracting the value of the prediction function from the value of the objective function; A regularization term is introduced to add a penalty term to the objective function to improve the generalization ability of the model.

3. The network anomaly intrusion detection model training method according to claim 1, It is characterized in that In deep reinforcement learning, each agent uses the Epslion-Greedy strategy to make action decisions based on its current state.

4. A network anomaly intrusion detection method, It is characterized in that The method comprises the following steps: Obtain the network traffic data to be detected; The network traffic data is input into a global detection model trained based on the network anomaly intrusion detection model training method according to any one of claims 1 to 3 to obtain a classification result of the network traffic data.

5. A network anomaly intrusion detection device, It is characterized in that The device comprises: An input module, used for acquiring network traffic data to be detected and inputting the network traffic data into a processing module; A processing module, comprising a global detection model trained by the network anomaly intrusion detection model training method according to any one of claims 1 to 3, and used for classifying the network traffic data; The output module is used to output the classification result of the network traffic data.

6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.