Dynamic weight federated learning anomaly detection method based on graph neural network

By building a graph neural network model on the client side and quantifying client model weights on the server side, the problems of low detection accuracy and data privacy leakage in traditional centralized machine learning methods are solved, and efficient anomaly detection and data privacy protection are achieved.

CN118734210APending Publication Date: 2024-10-01WUXI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410708885.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Traditional centralized machine learning methods have problems with low detection accuracy and risk of data privacy leakage in network intrusion detection.

Method used

The dynamic weighted federated learning anomaly detection method based on graph neural network is used to build an anomaly detection model on the client side, use graph convolution and Transformer technology to process graph structure and time series data, and measure the client model based on cosine similarity on the server side. weights to improve model performance and privacy protection.

Benefits of technology

It improves the accuracy and robustness of anomaly detection, is better than the comparison model, significantly improves the performance under the federated learning framework, and effectively processes graph structure and time series data, reducing the risk of data privacy leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734210A_ABST
    Figure CN118734210A_ABST
Patent Text Reader

Abstract

The invention relates to a dynamic weight federated learning anomaly detection method based on a graph neural network, and the method comprises the steps: constructing an anomaly detection model based on the graph neural network, and distributing the anomaly detection model to a client, and the anomaly detection model is constructed through the graph neural network; the client trains an anomaly detection model based on local data, obtains a client model and sends the client model to the server side, and the server side dynamically distributes weights to the client based on the client model in combination with a cosine similarity quantification method; acquiring a data set and distributing the data set to the client model, and acquiring a client anomaly detection result; updating the global model based on the client anomaly detection result and the weight of the client, and aggregating the updated global model to obtain a final anomaly detection model; and performing traffic anomaly detection based on the final anomaly detection model to obtain an anomaly detection result. According to the method, graph structure data and time sequence data can be effectively processed on the premise of protecting data privacy, and good performance is achieved under a federated learning framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things security technology, and in particular to a dynamic weighted federated learning anomaly detection method based on a graph neural network. Background Art

[0002] With the widespread application of computer networks and Internet of Things (IoT) systems, ensuring network security has become a key issue for all kinds of organizations. Traditional anomaly detection based on centralized machine learning (ML) methods has shown good results in improving the accuracy and efficiency of network intrusion detection systems (IDS). However, these methods also bring new challenges: in classic centralized machine learning methods, raw data needs to be transmitted from terminal devices to central servers for processing and analysis. The data transmission involved in this process may cause a series of security risks, including data leakage, data tampering, and unauthorized access. These security risks are particularly serious in areas where user data privacy is sensitive. Federated Learning (FL) has been proposed as an emerging machine learning paradigm. Federated learning aims to protect data privacy when training machine learning models in a distributed environment. In this paradigm, data is retained on local clients (such as mobile devices, IoT devices, etc.), while model training is performed on local clients. This approach avoids transmitting raw data to central servers, thereby reducing the risk of data leakage and privacy violation. Therefore, a dynamic weighted federated learning anomaly detection method based on graph neural networks is proposed. Summary of the invention

[0003] The purpose of the present invention is to address the problem of low detection accuracy of intrusion detection systems in the prior art, as well as the risks of data leakage and privacy leakage, and to provide a dynamic weighted federated learning anomaly detection method based on graph neural networks to enhance the ability of anomaly detection.

[0004] To achieve the above object, the present invention provides the following solutions:

[0005] A dynamic weight federated learning anomaly detection method based on graph neural network, comprising:

[0006] Building an anomaly detection model based on a graph neural network and distributing it to a client, wherein the anomaly detection model is built by a graph neural network;

[0007] The client trains the anomaly detection model based on local data, obtains the client model and sends it to the server, and the server dynamically distributes weights to the client based on the client model combined with a cosine similarity quantization method;

[0008] Acquire a data set and distribute it to the client model to obtain a client anomaly detection result, wherein the data set includes normal traffic data and abnormal traffic data;

[0009] Based on the client anomaly detection result and the weight of the client, the global model is updated, and the updated global model is aggregated to obtain a final anomaly detection model;

[0010] Based on the final anomaly detection model, traffic anomaly detection is performed to obtain an anomaly detection result.

[0011] Optionally, the anomaly detection model includes: an adjacency matrix construction module, a spatial convolution module, a temporal convolution module, and a prediction module, wherein the adjacency matrix construction module is used to construct an adjacency matrix of a graph based on nodes and edges in a data set; the spatial convolution module is used to extract node relationships based on the adjacency matrix; the temporal convolution module is used to extract node features based on the node relationships; and the prediction module is used to obtain anomaly prediction results based on the node features.

[0012] Optionally, the spatial convolution module adopts a graph convolutional neural network, the temporal convolution module adopts a Transformer including an attention mechanism, and the prediction module adopts a multi-layer perceptron.

[0013] Optionally, the server dynamically distributes weights to the client based on the client model in combination with a cosine similarity quantization method, including:

[0014] In the process of training based on local data, the quality of the client model is calculated by the difference between the current round of updates of the client model and the previous round of global model and the update loss value of the client model, and weights are distributed to the clients based on the quality, wherein the difference between the current round of updates of the client model and the previous round of global model is quantified using cosine similarity.

[0015] Optionally, the calculation method of the cosine similarity quantization is:

[0016] A k =0.5+0.5*cos(x,y)

[0017] Among them, x and y are random variables, A k The difference between the model update of client k in this round and the global model in the previous round.

[0018] Optionally, the update loss value of the client model is obtained by normalization, and the normalization calculation method is:

[0019]

[0020] in, is the update loss value of client k in the tth round, ranging from [0,1]; is the true training loss value of client k in round t; j is the sequence of clients, and N is the total number of clients.

[0021] Optionally, the mass is calculated as follows:

[0022] Q k =0.5*A k +0.5*L k

[0023] Among them, Q k is the quality of client k, A k is the difference between the model update of client k and the global model of the previous round, L k is the updated loss value of client k.

[0024] Optionally, after obtaining the client anomaly detection result, the method further includes calculating the loss of the client model using a cross entropy loss function, and updating the parameters of the client model based on the loss.

[0025] The beneficial effects of the present invention are:

[0026] The present invention introduces a dynamic weight mechanism in federated learning, and adjusts the weight of the client in the global model update according to the client's contribution to improve the model performance. In addition, it also combines graph neural network (GNN) and Transformer technology to model and process time series data on the local model to capture the dynamic changes in the dependencies between nodes and the time series, thereby improving the accuracy and robustness of anomaly detection. The present invention is superior to the comparative model in convergence speed and performance, effectively processes graph structure and time series data, and exhibits excellent performance under the federated learning framework. It has significant advantages in anomaly detection tasks while protecting data privacy, can effectively process graph structure data and time series data, and achieve good performance under the federated learning framework. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 This is a flow chart of a method for anomaly detection based on dynamic weighted federated learning of a graph neural network according to an embodiment of the present invention;

[0029] Figure 2 This is a flowchart of anomaly detection model training according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0032] This embodiment provides a dynamic weight federated learning anomaly detection method based on a graph neural network, including:

[0033] Building an anomaly detection model based on a graph neural network and distributing it to a client, wherein the anomaly detection model is built by a graph neural network;

[0034] The client trains the anomaly detection model based on local data, obtains the client model and sends it to the server, and the server dynamically distributes weights to the client based on the client model combined with a cosine similarity quantization method;

[0035] Acquire a data set and distribute it to the client model to obtain a client anomaly detection result, wherein the data set includes normal traffic data and abnormal traffic data;

[0036] Based on the client anomaly detection result and the weight of the client, the global model is updated, and the updated global model is aggregated to obtain a final anomaly detection model;

[0037] Based on the final anomaly detection model, traffic anomaly detection is performed to obtain an anomaly detection result.

[0038] Furthermore, the anomaly detection model includes: an adjacency matrix construction module, a spatial convolution module, a temporal convolution module, and a prediction module, wherein the adjacency matrix construction module is used to construct an adjacency matrix of a graph based on the nodes and edges in the data set; the spatial convolution module is used to extract the relationship between nodes based on the adjacency matrix; the temporal convolution module is used to extract node features based on the relationship between nodes; and the prediction module is used to obtain anomaly prediction results based on the node features.

[0039] The spatial convolution module adopts a graph convolutional neural network, the temporal convolution module adopts a Transformer including an attention mechanism, and the prediction module adopts a multi-layer perceptron.

[0040] Furthermore, in the process of training based on local data, the quality of the client model is calculated by the degree of difference between the current round of updates of the client model and the previous round of global model and the update loss value of the client model, and weights are distributed to the clients based on the quality, wherein the degree of difference between the current round of updates of the client model and the previous round of global model is quantified using cosine similarity.

[0041] After obtaining the client anomaly detection result, the method further includes calculating the loss of the client model using a cross entropy loss function, and updating the parameters of the client model based on the loss.

[0042] Combine the following Figure 1-Figure 2 This embodiment is described in detail. The anomaly detection model training process is as follows:

[0043] Step 1: The client trains the anomaly detection model based on local data, obtains the client model and sends it to the server, and the server distributes weights to the client based on the client model;

[0044] The distribution of weights is completed through the constructed dynamic weight federated learning system. During the training process, a weight is assigned to each client to reflect its contribution to the global model update. Dynamic weight federated learning can better balance the model quality differences between clients and improve the convergence speed and performance of the global model.

[0045] Dynamic weighted federated learning introduces a weight mechanism that gives greater weight to clients with similar update directions to the global model, thereby accelerating the convergence of the global model. In each round of communication, several clients are first randomly selected, and then these clients use local data to train the model and send the trained model to the server. The original intention of setting weights for each client is to balance the differences in model quality between clients. By assigning a weight to each client's model, the server can more accurately evaluate the contribution of the client model to the global model. Client models with higher weights will occupy a larger proportion in the aggregation process, while client models with lower weights will reduce their influence accordingly.

[0046] By dynamically adjusting the client's weight, dynamic weight federated learning can more accurately evaluate the contribution of the client model to the global model and accelerate the convergence of the global model.

[0047] The cosine similarity is chosen to quantify the degree of deviation between model parameters. This method helps to more fully understand the relationship between model parameters, thereby guiding parameter adjustment and optimization during model training. In this embodiment, the value range of cosine similarity is normalized to (0,1), and the formula is as follows:

[0048] A k =0.5+0.5*cos(x,y)

[0049] Among them, x and y are random variables, and Ak here is called the degree of difference, which describes the degree of difference between the client's update and the previous round of global model that the server needs to compare. k The value range of is [0,1], which can clearly indicate the degree of similarity between model updates. k The closer the value is to 1, the smaller the difference between the client's model update and the global model in the previous round is, that is, the two model updates are very close in direction and the updates are similar. k When the value of is close to 0, it means that the difference between the client's model update and the previous round of global model is very large, that is, the two model updates are far apart in direction and the updates are different.

[0050] The purpose of normalization is to map the client's loss value to between 0 and 1, so that all client loss values ​​have corresponding weights within this range. This process ensures a fairer weight distribution and better reflects the value of the client model update.

[0051] Normalized client loss value and difference degree A k By combining these two indicators, the server can more comprehensively evaluate the client's contribution to the global model. By combining these two indicators, the server can more accurately decide how to weight each client's model update to optimize the global model training process. The client's loss value is normalized, and the formula is as follows:

[0052]

[0053] in, is the training loss value indicator of client k in the tth round, and its value range is [0,1]. The closer the value is to 1, the smaller the loss value of the client is. is the actual training loss value of client k in round t. The client quality formula is as follows:

[0054] Q k =0.5*A k +0.5*L k

[0055] The larger the value of Q is, the better the quality of the client is, and the higher the weight is. k And the loss value index L k The sum of the previous coefficients is 1, and each is a normalized value, so the value range of client quality Q is [0,1]. Because the smaller the difference between the clients, the lower the heterogeneity of the dataset of the client, and the smaller the loss value, the better the training effect of the client model.

[0056] Finally, the Q of all clients are normalized to make their sum equal to 1 to ensure the rationality of weight distribution, and then the client models are weighted. As the communication progresses, the local loss of each client changes, and the similarity between the client and the central model also changes, so Q also changes dynamically, and the higher the quality of the client, the larger the Q value, which means that A k and L k The more reasonable the weight distribution of A is, the better the client's contribution is reflected in the global model. k When the weight of is high, it means that the client's update is highly similar to the global model, its data set heterogeneity is low, and its contribution is large. k When the weight is high, it means that the model training effect of the client is very good and its contribution is also large.

[0057] Step 2: Data preprocessing;

[0058] This embodiment uses the UNSW-NB15 dataset, which needs to be preprocessed, including data cleaning, feature extraction, data segmentation, etc.

[0059] Distribute data evenly to each client. The data set of each federated learning client needs to be divided into training set, validation set and test set to evaluate the training effect of the model, verify the generalization ability of the model, and finally test the actual performance of the model.

[0060] The data set of each client is divided into three subsets in a ratio of 8:1:1:

[0061] Training set: Contains about 80% of the data and is used to train the model so that the model can learn the characteristics of normal and abnormal behaviors.

[0062] Validation set: contains about 10% of the data and is used to verify the performance of the model during training to ensure that the model is not overfitting.

[0063] Test set: contains about 10% of the data and is used to test the generalization ability of the model after model training is completed, that is, the performance of the model on unseen data.

[0064] Step 3: Distribute the UNSW-NB15 dataset to the client model and obtain the client anomaly detection results;

[0065] The client model works as follows:

[0066] (1) The adjacency matrix construction module constructs the adjacency matrix of the graph;

[0067] The nodes and edges in the UNSW-NB15 dataset are represented as the adjacency matrix of the graph. For undirected graphs, the adjacency matrix is ​​symmetric; for directed graphs, the adjacency matrix is ​​usually asymmetric.

[0068] Input the UNSW-NB15 dataset into the adjacency matrix construction module and convert the time node X t and the edges are represented as the adjacency matrix A of the graph t , including the static adjacency matrix A s and the dynamic adjacency matrix A d .

[0069] (2) The spatial convolution module extracts the relationship between nodes;

[0070] In each graph convolutional layer, the features of the nodes are updated through an iterative propagation process. In each propagation process, the features of each node are determined by the features of its adjacent nodes and the weights of the edges. This can be achieved through matrix operations, where the features of the nodes are updated by the product of the adjacency matrix and the feature matrix.

[0071] This embodiment uses graph convolution neural networks (GCN) to model the relationship between nodes and update the representation of nodes by iterative propagation on the graph. The core idea of ​​GCN is to use the local neighborhood information of nodes to learn the feature representation of nodes. It can effectively use the local relationship between nodes to better capture the complex patterns and dependencies in the graph structure.

[0072] First, for the static adjacency matrix A s and the dynamic adjacency matrix A d , it needs to be symmetrically normalized to better capture the local structural information in the graph. The specific principle formula is as follows:

[0073]

[0074]

[0075] Among them, I is the identity matrix and D is the degree matrix, which is used to normalize the adjacency matrix to ensure the stability and numerical accuracy of the graph convolution operation. and They are the normalized static adjacency matrix and dynamic adjacency matrix respectively.

[0076] Next, two adjacency matrices are used to execute GCN in turn to extract the static relationship and dynamic relationship between variables. Assuming that the number of layers of GCN is k, the formula is as follows:

[0077]

[0078]

[0079]

[0080]

[0081] in, and Represent the static and dynamic initial node variable embedding matrices respectively, and They represent the static and dynamic node variable embedding matrices after the k-th layer of GCN convolution. Subsequently, the output results of the two adjacency matrices are weighted to obtain the final graph convolution result. The formula is as follows:

[0082]

[0083] Among them, X (k) ∈R N×T represents the result of graph convolution, η represents the weight of dynamic output, and its size is between [0,1].

[0084] (3) Temporal convolution module extracts node features;

[0085] After the GNN layer, the Transformer layer is used to further extract features in the graph structure. The Transformer layer contains a multi-head attention mechanism and a feedforward neural network layer, which can simultaneously model local and global features in the graph.

[0086] The core of Transformer is its encoder-decoder architecture, which can effectively process sequence data and understand and generate natural language. In Transformer, the core of encoder and decoder is the self-attention mechanism. The introduction of this mechanism strengthens the intrinsic connection between input sequences. After processing by multiple layers of self-attention mechanism and feedforward neural network layers, Transformer obtains a size of R T×d Output X o This output contains important information and features in the sequence and can be used in subsequent decoders or other tasks.

[0087] (4) The prediction module obtains abnormal prediction results;

[0088] After the Transformer layer, the features of the node are subjected to anomaly detection, and whether the node is abnormal is determined by comparing the features of the node with the features of normal nodes.

[0089] In order to utilize the information of each time step, X o Flatten into a one-dimensional vector, and then input it into a multilayer perceptron (MLP). MLP (Multilayer Perceptron, MLP) is a feedforward neural network that contains one or more hidden layers, each hidden layer contains a number of neurons, and uses an activation function to introduce nonlinearity. The output layer of MLP (Multilayer Perceptron, MLP) has only one neuron and uses the Sigmoid activation function to output a probability value between 0 and 1. This probability value can be interpreted as the probability that the sample belongs to category 1. If this probability value is greater than 0.5, the model predicts the sample as category 1; otherwise, it predicts category 0.

[0090] After the prediction is completed, the model needs to calculate the loss based on the predicted results and the actual labels. The cross entropy loss function L is used. s , which measures the difference between the probability distribution predicted by the model and the probability distribution of the true label. After calculating the loss, in order to train the model, the backpropagation algorithm is used to calculate the gradient of the loss function with respect to the model parameters. Then the gradient descent algorithm is used to update all the parameters of the model, including the weights of the convolutional layer, the weights and biases of the MLP (Multilayer Perceptron, MLP), etc. This process is repeated many times, and each iteration will make the model parameters closer to the optimal value, thereby improving the prediction performance of the model.

[0091] The method proposed in this embodiment is verified as follows:

[0092] This embodiment selects an experimental data set, and according to the evaluation criteria of this embodiment, the proposed method is compared with three different federated learning model combinations of FedAvg+LSTM, FedAvg+RNN, and FedAvg+GRU. The experimental environment is built on the Ubuntu 18.04.3LTS platform, using Intel Xeon E5-2618L v3 CPU and NVIDIAGeForce RTX 2080TI GPU (64GB RAM). In terms of the choice of programming language and framework, the detection model in this embodiment is built using Python language and Pytorch framework.

[0093] Specifically, the dataset selected is the UNSW-NB15 dataset, which is a public dataset widely used in network intrusion detection research. The dataset contains data from multiple clients, and the data of each client is stored in a CSV file. In order to conduct effective anomaly detection research, the dataset of each client needs to be divided into training set, validation set and test set to evaluate the training effect of the model, verify the generalization ability of the model, and finally test the actual performance of the model.

[0094] Specifically, each client's data set is divided into three subsets in a ratio of 8:1:1:

[0095] Training set: Contains about 80% of the data and is used to train the model so that the model can learn the characteristics of normal and abnormal behaviors.

[0096] Validation set: contains about 10% of the data and is used to verify the performance of the model during training to ensure that the model is not overfitting.

[0097] Test set: contains about 10% of the data and is used to test the generalization ability of the model after model training is completed, that is, the performance of the model on unseen data.

[0098] The specific implementation parameter settings are as follows:

[0099] (1) Time window size: seq_len is set to 50, and each time window contains data from 50 moments.

[0100] (2) GCN parameters: The number of nodes in GCN is 43, which corresponds to the 43 features in the feature setting. The input dimension is 50, the output dimension is 64, and the number of layers is 2.

[0101] (3) Transformer parameters: The number of encoder layers in the Transformer used for the temporal convolution module is 2, the number of attention heads per layer is 4, and the hidden layer dimension is 256.

[0102] (4) Adjacency matrix module: The embedding dimension is 64, and the weight η of the dynamic output is set to 0.3.

[0103] (5) Prediction module: It is configured with a 2-layer fully connected layer with 64 hidden layers and an output dimension of 1. It is also equipped with a Relu activation function and a Dropout mechanism with a dropout rate of 0.5.

[0104] (6) Federated learning: The client selection ratio C is set to 0.75, that is, 3 clients are randomly selected to participate in aggregation each time. The number of local training rounds E is set to 5, and the number of communication rounds r is set to 20.

[0105] (7) Training parameters: Batch size is set to 512, binary cross entropy loss function is used, learning rate is 0.005, Epoch is set to 5, and optimizer is Adam.

[0106] In order to fully verify the effectiveness of the method proposed in this embodiment, a series of evaluation indicators are used to measure its performance, including accuracy, precision, recall, F1-score and area under the PR curve (AUC-PR).

[0107] (1) Accuracy:

[0108]

[0109] (2) Recall rate:

[0110]

[0111] (3) Accuracy:

[0112]

[0113] (4) F1-score:

[0114]

[0115] (5) AUC-ROC:

[0116]

[0117] Table 1 shows the structure of the model used in the method of this embodiment, including the type of each layer and the expected output shape. In the GCN layer and the Dense layer, the feature vector of each node has 43 elements, and the dimension of each vector is 64. In the Transformer layer, the feature vector of each node has 64 elements, and the dimension of each vector is also 64. In the last Dense layer, the feature vector of each node has only one element, and its dimension is 1. This structural design helps the model learn the dependencies between nodes when processing graph data and capture long-term and short-term temporal features on time series data.

[0118] Table 1

[0119]

[0120] The method of this embodiment is experimentally compared with the FedAvg+RNN, FedAvg+LSTM and FedAvg+GRU models. In order to evaluate the actual effect of the method of this embodiment and the comparison algorithm, the training process is divided into multiple cycles, each cycle containing multiple rounds of communication. In this experiment, the training cycle is set to 20 rounds. After 20 rounds of communication, the average ACC index under each round of communication is collected. The specific results are shown in Table 2. Compared with other methods, the FedGCNTrans framework proposed in the method of this embodiment has a certain degree of optimization and improvement in the evaluation of various experimental indicators such as accuracy, precision, recall, F1 score, and area under the PR curve (AUC-PR).

[0121] Table 2

[0122]

[0123]

[0124] In summary, compared with other network intrusion detection methods based on federated learning, the method proposed in this embodiment is superior to the comparative models in terms of convergence speed and performance indicators, has significant advantages in anomaly detection tasks, can effectively process graph structure data and time series data, and achieve good performance under the federated learning framework.

[0125] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A dynamic weight federated learning anomaly detection method based on graph neural network, characterized in that: include: Building an anomaly detection model based on a graph neural network and distributing it to a client, wherein the anomaly detection model is built by a graph neural network; The client trains the anomaly detection model based on local data, obtains the client model and sends it to the server, and the server dynamically distributes weights to the client based on the client model combined with a cosine similarity quantization method; Acquire a data set and distribute it to the client model to obtain a client anomaly detection result, wherein the data set includes normal traffic data and abnormal traffic data; Based on the client anomaly detection result and the weight of the client, the global model is updated, and the updated global model is aggregated to obtain a final anomaly detection model; Based on the final anomaly detection model, traffic anomaly detection is performed to obtain an anomaly detection result.

2. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 1 is characterized in that: The anomaly detection model includes: an adjacency matrix construction module, a spatial convolution module, a temporal convolution module, and a prediction module, wherein the adjacency matrix construction module is used to construct an adjacency matrix of a graph based on nodes and edges in a data set; the spatial convolution module is used to extract node relationships based on the adjacency matrix; the temporal convolution module is used to extract node features based on the node relationships; and the prediction module is used to obtain anomaly prediction results based on the node features.

3. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 2 is characterized in that: The spatial convolution module adopts a graph convolutional neural network, the temporal convolution module adopts a Transformer including an attention mechanism, and the prediction module adopts a multi-layer perceptron.

4. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 1 is characterized in that: The server dynamically distributes weights to the client based on the client model in combination with a cosine similarity quantization method, including: In the process of training based on local data, the quality of the client model is calculated by the difference between the current round of updates of the client model and the previous round of global model and the update loss value of the client model, and weights are distributed to the clients based on the quality, wherein the difference between the current round of updates of the client model and the previous round of global model is quantified using cosine similarity.

5. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 4 is characterized in that: The calculation method of the cosine similarity quantization is: TO k =0.5+0.5*cos(x,y) Among them, x and y are random variables, A k The difference between the model update of client k in this round and the global model in the previous round.

6. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 4 is characterized in that: The update loss value of the client model is obtained by normalization, and the normalization calculation method is: in, is the update loss value of client k in the tth round, ranging from [0,1]; is the true training loss value of client k in round t; j is the sequence of clients, and N is the total number of clients.

7. The method for anomaly detection based on dynamic weighted federated learning of graph neural network according to claim 4 is characterized in that: The mass is calculated as follows: Q k =0.5*A k +0.5*L k Among them, Q k is the quality of client k, A k is the difference between the model update of client k and the global model of the previous round, L k is the updated loss value of client k.

8. The dynamic weight federated learning anomaly detection method based on graph neural network according to claim 1 is characterized in that: After obtaining the client anomaly detection result, the method further includes calculating the loss of the client model using a cross entropy loss function, and updating the parameters of the client model based on the loss.

Citation Information

Cited By

  • Data anomaly detection method and system based on quantum graph federated learning

    CN118964626A

  • Transform and GNN hybrid model-based Internet of Things intrusion detection method, model and training method thereof, and electronic equipment

    CN119341825A

  • Internet of Things intrusion detection method, model, training method, and electronic device based on Transformer and GNN hybrid model

    CN119341825B