A secure hierarchical federated learning approach based on isolation forest anomaly detection

By generating personalized anomaly detection intensity threshold decisions for each server, using the GRU self-attention model and the isolated forest algorithm for abnormal detection, the problem of insufficient server security is solved, and reasonable detection intensity allocation is achieved according to different attack degrees, improving the security of the server.

CN119272846BActive Publication Date: 2025-03-18HUNAN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411789943.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-18
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

In the prior art, the difference in the degree of attacks suffered by the server leads to unreasonable allocation of detection intensity, resulting in insufficient server security.

Method used

By generating personalized anomaly detection intensity threshold decisions for each server, the timing feature state is extracted using the GRU self-attention model, and anomaly detection is performed in combination with the isolated forest algorithm, and the detection intensity is adaptively adjusted to cope with different attack degrees.

Benefits of technology

It realizes the reasonable allocation of detection strength according to the degree of attacks of different servers, improves the security of the server, and solves the problem of insufficient server security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272846B_ABST
    Figure CN119272846B_ABST
Patent Text Reader

Abstract

The present invention discloses a secure hierarchical federated learning method based on isolation forest anomaly detection, and relates to the technical field of electronic digital data processing. The method comprises the following steps: establishing a GRU self-attention model on the edge server side, extracting the temporal feature state of the global parameter through the GRU self-attention model, using the isolation forest algorithm to build a tree of the temporal feature state of the aggregated GRU self-attention model update parameter, comparing the anomaly detection strength evaluation coefficient with the anomaly detection strength threshold after the GRU self-attention model parameter is aggregated, and taking measures to adaptively adjust the anomaly detection strength or issue an alarm according to the comparison result. The present invention generates a personalized anomaly detection strength threshold decision for each server, fully considers the difference in the degree of attack suffered by different servers, and reasonably allocates the detection strength, thereby achieving the effect of improving the security of the server and solving the problem of insufficient server security in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a secure hierarchical federated learning method based on isolation forest anomaly detection. Background Art

[0002] With the development of wireless communication technology and people's increasing attention to the data privacy and security of mobile electronic products, the hierarchical federated learning framework based on "cloud-edge-end" collaboration has received more and more attention. Under this framework, the training of the global model requires uploading the local model trained by the local mobile device to the edge server closer to the device for partial aggregation, and then uploading the aggregated model to the central server for global aggregation. This process can realize model training and updating while protecting data privacy. However, during the local training and model transmission process of the hierarchical federated learning framework, normal data or models may suffer from illegal attacks such as data poisoning and model poisoning, affecting the training results of the global model.

[0003] An existing secure hierarchical federated learning method based on isolation forest anomaly detection is implemented by uploading a local model trained on a local mobile device to an edge server close to the device for partial aggregation, and then uploading the aggregated model to a central server for global aggregation.

[0004] For example, the patent application with publication number CN116451117A discloses a method for detecting anomalies in power data based on federated learning, including: (1) preprocessing of fault detection data: establishing a multi-dimensional time series client; data preprocessing; building a time window; (2) building a local model based on a time-domain convolutional neural network and a self-attention mechanism: initializing the model input; single-layer fusion encoder operation; decoding operation; building a model loss function; performing anomaly scoring; and updating local model parameters; (3) using a federated learning model on the server side to implement joint training: building a model loss function; updating local model parameters; after updating the local model parameters through the above process, uploading them to the terminal server for aggregation to generate a global model.

[0005] For example, the invention patent announcement number is CN112749392B, which is a method and system for detecting abnormal nodes in federated learning, including: system initialization, user registration, system parameter generation and key negotiation; masked local model generation; malicious user detection, including local model aggregation on the server side to generate a confused aggregation model, the user side verifies the confused aggregation model to generate a verification result, and the server side performs malicious user detection based on the user side verification result; the server uses the masked local model uploaded by non-malicious users to perform model aggregation, obtains the global model of the current iteration round and sends it to the user, and the user updates the local model based on the received global model. The detection system consists of an aggregation server, a trust authority and several users.

[0006] However, in the process of implementing the technical solution of the invention in the embodiments of the present application, the present application found that the above technology has at least the following technical problems:

[0007] In the prior art, different servers are subjected to different degrees of attacks. An attack that is too strong may not be avoided by adjusting the detection strength. An attack that is too weak may also put a load on the computer's computing power if the detection strength is too strong. Therefore, there is a problem of insufficient server security in allocating detection strength. Summary of the invention

[0008] The embodiment of the present application solves the problem of insufficient server security in the prior art by providing a secure hierarchical federated learning method based on isolation forest anomaly detection, thereby achieving the effect of improving server security.

[0009] The embodiment of the present application provides a secure hierarchical federated learning method based on isolation forest anomaly detection, comprising the following steps: S1, obtaining and initializing global model parameters on a cloud server, and distributing them to an edge server, which is then distributed to a mobile device by the edge server. The mobile device directly obtains a local data set of the global model parameters from a database, and the mobile device uses the local data set to update the global model parameters, and uploads the updated global model parameters to the edge server; S2, establishing a GRU self-attention model on the edge server, and extracting time series feature states of the updated global model parameters on the edge server through the GRU self-attention model to obtain extraction anomaly evaluation coefficients of time series feature states at different model levels, and the edge server uses a federated flat The average algorithm aggregates the GRU self-attention model to obtain the aggregated GRU self-attention model, uses the isolation forest algorithm to build a tree of the temporal feature states of the aggregated GRU self-attention model update parameters, obtains the temporal feature state tree building evaluation coefficient, and directly obtains the anomaly detection strength threshold of the GRU self-attention model parameters after aggregation from the database; S3, by analyzing the comprehensive extraction anomaly evaluation coefficient of the temporal feature state and the temporal feature state tree building evaluation coefficient, obtains the anomaly detection strength evaluation coefficient for identifying abnormal updates, and compares the anomaly detection strength evaluation coefficient with the anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, and takes measures to adaptively adjust the anomaly detection strength or issue an alarm according to the comparison results.

[0010] Furthermore, the specific update process of the mobile device using the local data set to update the global model parameters is as follows: the mobile device calculates the loss value of each round of training, and the mobile device uses the stochastic gradient descent method to perform gradient updates in a random selection manner to minimize the loss function of the training data, and updates the model parameters through continuous iteration to obtain updated model parameters.

[0011] Furthermore, the specific extraction process of extracting the temporal feature states of the updated global model parameters on the edge server through the GRU self-attention model is as follows: the updated model parameters uploaded by the mobile device are transmitted to the self-attention model GRU on the edge server, and the GRU self-attention model is used to extract the temporal feature states of the original parameters for each layer of the model parameters, and output them in units of model levels to obtain the extraction anomaly evaluation coefficients of the temporal feature states of different model levels, and the extraction anomaly evaluation coefficients of the temporal feature states of different model levels are combined to obtain the comprehensive extraction anomaly evaluation coefficient of the temporal feature states.

[0012] Furthermore, the specific aggregation process of the edge server using the federated averaging algorithm to aggregate local model updates is as follows: the mobile device uploads the updated model parameters to the edge server, and the edge server assigns a weight to the update of each client based on the amount of data of each client, sums up the weighted updates of all clients, and adds the result of the sum of the weighted updates of all clients to the global model parameters to obtain new global model parameters.

[0013] Furthermore, the specific tree building process of using the isolation forest algorithm to build a tree for the temporal feature state of the aggregated GRU self-attention model update parameters is as follows: randomly select a sample from the local data set as a subset, select a feature and a random value of the feature as a split point, divide the subset into two parts, repeat the splitting steps until the size of the subset is reduced to 1 or reaches the preset tree depth limit, and randomly select multiple samples as trees in the isolation forest.

[0014] Furthermore, the specific comparison process of comparing the anomaly detection strength evaluation coefficient with the anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters is as follows: the anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters is divided into a first anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, a second anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, and a third anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters; if the anomaly detection strength evaluation coefficient is less than or equal to the first anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, the security monitoring of the edge server is strengthened according to the anomaly detection strength evaluation coefficient, and the communication between the client and the edge server is encrypted using a security protocol ... The estimation coefficient is less than or equal to the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the first threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated. According to the anomaly detection strength evaluation coefficient, mutual authentication between the client and the server is implemented, and the structure of the isolation forest model is adjusted according to the detection requirements. If the anomaly detection strength evaluation coefficient is less than or equal to the third threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, the heterogeneity of the client data is processed according to the anomaly detection strength evaluation coefficient. If the anomaly detection strength evaluation coefficient is greater than the third threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, an alarm is issued to remind relevant personnel.

[0015] Furthermore, the global model parameters include: GRU self-attention model parameters: the number of GRU layers, the number of neurons in each layer, the activation function, the activation function of the gate, the activation function of the hidden state, and whether to return all outputs of the sequence or only the last output; Isolation Forest algorithm parameters: the number of trees in the isolation forest, the number of samples drawn when training each tree, the expected proportion of outliers in the dataset, the number of features when finding split points, and the number of jobs running in parallel.

[0016] Furthermore, the specific construction process of the GRU self-attention model is as follows: initialize a GRU network, design the network structure of the GRU, including the number of GRU layers, the number of neurons in each layer, the activation function, the activation function of the gate, the activation function of the hidden state, and whether to return all outputs of the sequence or only the last output; after the GRU layer, design a multi-head attention mechanism, establish independent weight matrices in multiple parallel attention layers, calculate the linear transformation of queries, keys, and values ​​in independent weight matrices, analyze the dot product of queries and keys through a softmax function to obtain attention weights, multiply the attention weights by the values ​​and sum them to obtain the output of the self-attention layer, and combine the GRU layer and the self-attention layer to form an end-to-end GRU self-attention model.

[0017] Furthermore, the specific adjustment method of adaptively adjusting the anomaly detection strength according to the anomaly detection strength evaluation coefficient is as follows: adaptively adjusting the anomaly detection strength includes processing the heterogeneity of client data, strengthening security monitoring on the edge server side, encrypting the communication between the client and the edge server using a security protocol, implementing mutual authentication between the client and the server, and adjusting the structure of the isolation forest model according to detection requirements.

[0018] Furthermore, the specific method for obtaining the anomaly detection strength evaluation coefficient is as follows: ; In the formula, Expressed as the anomaly detection strength assessment coefficient, It is expressed as the evaluation coefficient of the time series feature state tree. Represents the weight factor for the evaluation coefficient of the time series feature state tree, Expressed as the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the weight factor of the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the difference between the accuracy of the aggregated global model and 1. The weight factor expressed as the difference between the accuracy of the aggregated global model and 1, Expressed as a natural constant.

[0019] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0020] 1. By generating a personalized anomaly detection strength threshold decision for each server, the differences in the degree of attacks suffered by different servers are fully considered, and the detection strength is reasonably allocated, so as to achieve the effect of improving server security and solve the problem of insufficient server security in the existing technology;

[0021] 2. By using random forest to analyze the characteristic status of historical parameters and perform abnormal scoring for each layer of model parameters, the security of model training is ensured, thereby achieving the effect of improving the security of model training and solving the problem of insufficient model training security in the existing technology;

[0022] 3. By taking each layer of the model parameters as a unit, the model parameters are converted into feature states, and isolated forests are constructed for each layer of features obtained, thereby achieving the effect of improving the accuracy of feature extraction and solving the problem of insufficient feature extraction accuracy in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flow chart of a secure hierarchical federated learning method based on isolation forest anomaly detection provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of an ideal state of a secure hierarchical federated learning method based on isolation forest anomaly detection provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the effectiveness of the GRU model and DRL module provided in the embodiments of the present application;

[0026] Figure 4 An image of the evaluation coefficients of the time series feature state tree construction in a secure hierarchical federated learning method based on isolation forest anomaly detection provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The embodiment of the present application solves the problem of insufficient server security in the prior art by providing a secure hierarchical federated learning method based on isolation forest anomaly detection. By generating a personalized anomaly detection strength threshold decision for each server, the differences in the degree of attacks suffered by different servers are fully considered, and the detection strength is reasonably allocated, thereby achieving the effect of improving server security.

[0028] The technical solution in the embodiment of the present application is to solve the above-mentioned problem of insufficient server security, and the overall idea is as follows:

[0029] By generating personalized anomaly detection strength threshold decisions for each server, fully considering the differences in the degree of attacks suffered by different servers, and reasonably allocating detection strength, the effect of improving server security is achieved.

[0030] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0031] like Figure 1 As shown, it is a flow chart of a secure hierarchical federated learning method based on isolation forest anomaly detection provided by an embodiment of the present application, and the method includes the following steps: S1, obtaining and initializing global model parameters on the cloud server, and distributing them to the edge server, and then distributing them to the mobile device by the edge server, the mobile device directly obtains the local data set of the global model parameters from the database, the mobile device uses the local data set to update the global model parameters, and uploads the updated global model parameters to the edge server; S2, establishing a GRU (gated recurrent unit) self-attention model on the edge server, the updated global model parameters on the edge server extract the time series feature state through the GRU self-attention model, and obtain the extraction anomaly evaluation coefficients of the time series feature states of different model levels, and the edge The edge server uses the federated averaging algorithm to aggregate the GRU self-attention model to obtain the aggregated GRU self-attention model, uses the isolation forest algorithm to build a tree of the temporal feature states of the aggregated GRU self-attention model update parameters, obtains the temporal feature state tree building evaluation coefficient, and directly obtains the anomaly detection strength threshold of the GRU self-attention model parameters after aggregation from the database; S3, by analyzing the comprehensive extraction anomaly evaluation coefficient of the temporal feature state and the temporal feature state tree building evaluation coefficient, obtains the anomaly detection strength evaluation coefficient for identifying abnormal updates, and compares the anomaly detection strength evaluation coefficient with the anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, and takes measures to adaptively adjust the anomaly detection strength or issue an alarm based on the comparison results.

[0032] In this embodiment, a secure hierarchical federated learning method based on isolation forest anomaly detection can be applied to anti-money laundering and fraud detection in the financial field, device monitoring in the Internet of Things, and telecommunications. When an edge server is attacked, it will cause losses to customers. Therefore, this method can adjust the detection strength of the edge server to avoid the attack. The edge server can have an adaptive anomaly detection mechanism of DRL (deep learning algorithm), such as Figure 2 As shown, it is a schematic diagram of an ideal state of a secure hierarchical federated learning method based on isolation forest anomaly detection provided by an embodiment of the present application. The DRL module monitors the state changes of the environment in real time, and selects personalized anomaly detection threshold strengths for different edge servers according to the actual attack situation suffered by the client, so as to avoid the problem of a unified monitoring threshold causing a decrease in the accuracy of the global model. Figure 3As shown, it is a schematic diagram of the effectiveness of the GRU model and DRL module provided in an embodiment of the present application. In order to verify the effectiveness of the GRU model and DRL module in secure hierarchical federated learning, the GRU module learns the characteristic state of the local model parameters transmitted by the mobile device, and analyzes the changing trend of the client model during the training process through the historical characteristic state stored in the GRU, which helps to identify the model that has been attacked maliciously during the training process.

[0033] Furthermore, the specific update process of the mobile device using the local data set to update the global model parameters is as follows: the mobile device calculates the loss value of each round of training, and the mobile device uses the stochastic gradient descent method to perform gradient updates in a random selection manner to minimize the loss function of the training data, and updates the model parameters through continuous iteration to obtain updated model parameters.

[0034] In this embodiment, the specific calculation process of calculating the loss Loss value of each round of training is:

[0035] ;

[0036] in, Represents the mobile device model in the local dataset The local loss function on are model parameters, Indicates the number of clients.

[0037] Use the stochastic gradient descent method to randomly select samples from each small batch to minimize the loss function of the training data, and iteratively update the model parameters to obtain the updated model parameters:

[0038] ;

[0039] represents the learning rate, represents the current gradient update, Indicates the number of clients. Indicates the number of mini-batches.

[0040] When the edge server is attacked by network poisoning, the function of the edge server is damaged and the above calculation and analysis cannot be performed. Therefore, it needs to be performed on the mobile device. When the edge server is attacked, it will affect the communication frequency between the mobile device and the edge server, and thus affect the samples extracted for tree building in the local data set.

[0041] Furthermore, the specific extraction process of extracting the temporal feature states of the updated global model parameters on the edge server through the GRU self-attention model is as follows: the updated model parameters uploaded by the mobile device are transmitted to the self-attention model GRU on the edge server, and the GRU self-attention model is used to extract the temporal feature states of the original parameters for each layer of the model parameters, and output them in units of model levels to obtain the extraction anomaly evaluation coefficients of the temporal feature states of different model levels, and the extraction anomaly evaluation coefficients of the temporal feature states of different model levels are combined to obtain the comprehensive extraction anomaly evaluation coefficient of the temporal feature states.

[0042] In this embodiment, on the client side, the updated parameters of the local model are obtained through model distillation, and these parameters are encrypted and uploaded to the edge server. On the edge server side, the GRU self-attention model receives these uploaded model parameters, and the model parameters are decomposed by layer. The parameters of each layer are input into the GRU self-attention model. The GRU self-attention model analyzes the time series characteristics of the parameters of each layer. For the parameters of each layer, the GRU self-attention model outputs an abnormal evaluation coefficient extracted by a time series feature state. By analyzing the time series characteristics of the model parameters, the GRU self-attention model can more accurately identify abnormal behavior and improve the accuracy of anomaly detection.

[0043] Furthermore, the specific aggregation process of the edge server using the federated averaging algorithm to aggregate local model updates is as follows: the mobile device uploads the updated model parameters to the edge server, and the edge server assigns a weight to the update of each client based on the amount of data of each client, sums up the weighted updates of all clients, and adds the result of the sum of the weighted updates of all clients to the global model parameters to obtain new global model parameters.

[0044] In this embodiment, the update parameters of the local model are obtained through model distillation, and these parameters are encrypted and uploaded to the edge server. The edge server is directly linked to the client, and the edge server assigns weights according to the amount of data of each client. For example, clients with larger amounts of data will have higher weights because they provide more information for training. The edge server multiplies the model update of each client by its corresponding weight. The server sums all weighted client updates and adds the result of the weighted update summation to the current global model parameters to obtain new global model parameters. These parameters will be used for the next round of training or reasoning. By assigning weights according to the amount of data, it can be ensured that the model update more accurately reflects the contribution of each client and improves the generalization ability of the model.

[0045] Furthermore, the specific tree building process of using the isolation forest algorithm to build a tree for the temporal feature state of the aggregated GRU self-attention model update parameters is as follows: randomly select a sample from the local data set as a subset, select a feature and a random value of the feature as a split point, divide the subset into two parts, repeat the splitting steps until the size of the subset is reduced to 1 or reaches the preset tree depth limit, and randomly select multiple samples as trees in the isolation forest.

[0046] In this embodiment, a sample is randomly selected from the local data set as the starting point of the subset. In the selected sample, a feature is randomly selected. For this feature, a value is randomly selected as the split point. The selected feature and split point are used to divide the current subset into two parts, one part contains samples less than or equal to the split point, and the other part contains samples greater than the split point. The above segmentation steps are repeated for each segmented subset until the size of the subset is reduced to 1 or the preset tree depth limit is reached. Isolation forest is used for fast segmentation. This process does not require pruning. The above process is repeated multiple times, and different samples are randomly selected each time to build multiple trees. These trees together constitute an isolation forest for anomaly detection. The construction process of the isolation forest is very fast, does not require complex feature selection and optimization, and is suitable for processing large-scale data sets.

[0047] Furthermore, the specific comparison process of comparing the anomaly detection strength evaluation coefficient with the anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters is as follows: the anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters is divided into a first anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, a second anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, and a third anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters; if the anomaly detection strength evaluation coefficient is less than or equal to the first anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters, the security monitoring of the edge server is strengthened according to the anomaly detection strength evaluation coefficient, and the communication between the client and the edge server is encrypted using a security protocol ... The estimation coefficient is less than or equal to the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the first threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated. According to the anomaly detection strength evaluation coefficient, mutual authentication between the client and the server is implemented, and the structure of the isolation forest model is adjusted according to the detection requirements. If the anomaly detection strength evaluation coefficient is less than or equal to the third threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, the heterogeneity of the client data is processed according to the anomaly detection strength evaluation coefficient. If the anomaly detection strength evaluation coefficient is greater than the third threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, an alarm is issued to remind relevant personnel.

[0048] In this embodiment, the GRU self-attention model is used to aggregate the model parameters in the federated learning to capture the temporal relationship and dependency between the parameters. The abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters is calculated in combination with the database, and the abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters is divided into a first abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters, a second abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters, and a third abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters. The first abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters is less than the second abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters, and the second abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters is less than the third abnormal detection strength threshold after the aggregation of the GRU self-attention model parameters. The calculated abnormal detection strength evaluation coefficient is compared with the abnormal detection strength thresholds after the aggregation of different GRU self-attention model parameters. If the abnormal detection strength evaluation coefficient is less than or equal to the GRU self-attention model The first threshold of the anomaly detection strength after parameter aggregation, according to the anomaly detection strength evaluation coefficient, strengthen the security monitoring of the edge server and use the security protocol to encrypt the communication between the client and the edge server. If the anomaly detection strength evaluation coefficient is less than or equal to the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the first threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, the mutual authentication between the client and the server is implemented according to the anomaly detection strength evaluation coefficient, and the structure of the isolation forest model is adjusted according to the detection requirements. If the anomaly detection strength evaluation coefficient is less than or equal to the third threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated and greater than the second threshold of the anomaly detection strength after the GRU self-attention model parameters are aggregated, the heterogeneity of the client data is processed according to the anomaly detection strength evaluation coefficient. If the anomaly detection strength evaluation coefficient is greater than the threshold, an alarm is issued and relevant personnel are reminded to conduct further review and investigation on the model update. By adaptively adjusting the anomaly detection strength, the system can respond to different attack modes more flexibly and improve the targeted defense.

[0049] Furthermore, the global model parameters include: GRU self-attention model parameters: the number of GRU layers, the number of neurons in each layer, the activation function, the activation function of the gate, the activation function of the hidden state, and whether to return all outputs of the sequence or only the last output; Isolation Forest algorithm parameters: the number of trees in the isolation forest, the number of samples drawn when training each tree, the expected proportion of outliers in the dataset, the number of features when finding split points, and the number of jobs running in parallel.

[0050] In this embodiment, the number of GRU layers refers to the number of GRU layers stacked in the GRU (Gated Recurrent Unit) model. The more layers, the stronger the expressive power of the model is usually, but it is also more prone to overfitting and has a higher computational cost. The number of neurons in each layer refers to the number of neurons contained in each GRU layer. The more neurons, the stronger the representation power of the layer, but it may also increase the risk of overfitting. The activation function in the GRU layer refers to the activation function used by the update gate, reset gate, and candidate hidden state. Commonly used ones are Sigmoid (S-type function, also known as S-type growth curve) and tanh function (hyperbolic tangent function). The activation function of the gate refers to the activation function used by the update gate and reset gate in the GRU, usually the Sigmoid function, because they need to output a value between 0 and 1 to control the flow of information. The activation function of the hidden state refers to the activation function used by the hidden state output by the GRU layer, usually the tanh function, which is used to provide nonlinear characteristics. Whether to return all outputs of the sequence or only the last output, this parameter determines whether the model outputs the hidden state sequence of the entire sequence or only the hidden state of the last time step of the sequence. For sequence prediction tasks, the output of the entire sequence may be required, while for time point prediction, only the last output may be required.

[0051] Furthermore, the specific construction process of the GRU self-attention model is as follows: initialize a GRU network, design the network structure of the GRU, including the number of GRU layers, the number of neurons in each layer, the activation function, the activation function of the gate, the activation function of the hidden state, and whether to return all outputs of the sequence or only the last output; after the GRU layer, design a multi-head attention mechanism, establish independent weight matrices in multiple parallel attention layers, calculate the linear transformation of queries, keys, and values ​​in independent weight matrices, analyze the dot product of queries and keys through a softmax function to obtain attention weights, multiply the attention weights by the values ​​and sum them to obtain the output of the self-attention layer, and combine the GRU layer and the self-attention layer to form an end-to-end GRU self-attention model.

[0052] In this embodiment, a specific construction example of the GRU self-attention model is as follows: the GRU network is initialized and the GRU network is designed: the number of GRU layers is 2, the number of neurons in each layer is 128, the activation function is the hyperbolic tangent function tanh, the activation function of the gate is the Sigmoid function, the activation function of the hidden state is the same as the activation function, which is tanh, and all outputs are returned or only the last output is returned.

[0053] After the GRU layer, a multi-head attention mechanism is designed: the number of parallel attention layers is 8, and each attention layer has an independent weight matrix for calculating the query (Q), key (K), and value (V). In each weight matrix, Q, K, and V are linearly transformed, and the dot product of Q and K is calculated. The attention weight is obtained through the softmax function, and the attention weight is multiplied with V and summed to get the output of the self-attention layer.

[0054] By calling the TensorFlow library in Python to combine the GRU layer and the self-attention layer, an end-to-end GRU self-attention model is formed. The model input is the model update parameter sequence in federated learning, and the model output is the aggregated parameters and anomaly detection strength threshold. The GRU layer can capture the temporal relationship between parameters, and the multi-head attention mechanism can enhance the model's emphasis on different parameters. The combination of the two can provide richer representation.

[0055] Furthermore, the specific adjustment method of adaptively adjusting the anomaly detection strength according to the anomaly detection strength evaluation coefficient is as follows: adaptively adjusting the anomaly detection strength includes processing the heterogeneity of client data, strengthening security monitoring on the edge server side, encrypting the communication between the client and the edge server using a security protocol, implementing mutual authentication between the client and the server, and adjusting the structure of the isolation forest model according to detection requirements.

[0056] In this embodiment, for some important financial customers, the comparison threshold method can be skipped and manual intervention can be performed directly to improve security and avoid risks.

[0057] Heterogeneous processing of client data means that in the isolation forest model, feature selection or data preprocessing steps are used to standardize and normalize the data according to the data characteristics of different clients to ensure that the model can adapt to heterogeneous data. For clients with large data volumes, the number of trees in the isolation forest can be increased, while for clients with small data volumes, the number of trees can be reduced to avoid overfitting. If overfitting cannot be avoided by reducing the number of trees, the clock frequency of the edge server CPU can be directly increased to speed up the calculation process.

[0058] Strengthening security monitoring on the edge server side means that the edge server side continuously monitors model updates from various clients and uses the isolation forest algorithm to evaluate anomaly scores in real time. If the anomaly score is detected to exceed the preset threshold, the edge server side can trigger security measures, such as pausing updates or increasing the hard disk rotation speed to increase the speed of accessing data.

[0059] Using a security protocol to encrypt communications between the client and the edge server means using a security protocol such as TLS / SSL to encrypt communications between the client and the edge server to ensure the confidentiality and integrity of model updates during transmission, or directly encrypting securely from the edge server network port.

[0060] Implementing mutual authentication between the client and the server means ensuring that both parties in communication between the client and the edge server are authenticated through a digital certificate mechanism, preventing unauthorized participants from joining the federated learning process. At the same time, the network IP of the client and the edge server can also be encrypted to ensure that mutual authentication proceeds smoothly.

[0061] Adjusting the structure of the isolation forest model according to detection requirements refers to dynamically adjusting the structure of the isolation forest model according to the requirements of anomaly detection, for example, increasing or decreasing the depth of the tree and changing the size of subsampling.

[0062] Furthermore, the specific method for obtaining the anomaly detection strength evaluation coefficient is as follows: ; In the formula, Expressed as the anomaly detection strength assessment coefficient, It is expressed as the evaluation coefficient of the time series feature state tree. Represents the weight factor for the evaluation coefficient of the time series feature state tree, Expressed as the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the weight factor of the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the difference between the accuracy of the aggregated global model and 1. The weight factor expressed as the difference between the accuracy of the aggregated global model and 1, Expressed as a natural constant.

[0063] In this embodiment, the weight factor of the time series feature state tree construction evaluation coefficient, the weight factor of the comprehensive extraction anomaly evaluation coefficient of the time series feature state, and the weight factor of the difference between the precision of the aggregated global model and 1 can be obtained through the dynamic information database. The weight factor of the time series feature state tree construction evaluation coefficient, the weight factor of the comprehensive extraction anomaly evaluation coefficient of the time series feature state, and the weight factor of the difference between the precision of the aggregated global model and 1 are also established through the relationship between the time series feature state tree construction evaluation coefficient, the comprehensive extraction anomaly evaluation coefficient of the time series feature state, and the difference between the precision of the aggregated global model and 1 and the dynamic information. The corresponding weight factor of the time series feature state tree construction evaluation coefficient, the weight factor of the comprehensive extraction anomaly evaluation coefficient of the time series feature state, and the weight factor of the difference between the precision of the aggregated global model and 1 in the mapping set are obtained by inputting the real-time time series feature state tree construction evaluation coefficient, the comprehensive extraction anomaly evaluation coefficient of the time series feature state, and the difference between the precision of the aggregated global model and 1.

[0064] In this embodiment, the specific method for obtaining the comprehensive extraction abnormality assessment coefficient of the time series feature state is:

[0065] ;

[0066] In the formula, It is expressed as the comprehensive extraction anomaly evaluation coefficient of the time series feature state, which refers to the evaluation value of anomalies when the GRU self-attention model performs feature extraction. Different GRU layers are numbered. , It is represented by the total number of GRU layers, tanh is the activation function of the GRU self-attention model, Represents the activation function used by the GRU self-attention model to update the gate, reset the gate, and candidate hidden states. Represented as the number of neurons in the i-th GRU layer, Represented as the eigenvalue of the reset gate weight matrix in the i-th GRU layer, Represented as the eigenvalue of the update gate weight matrix in the i-th GRU layer, Represents the output of the i-th GRU layer, including whether to return all outputs of the sequence or only the last output. =1, if only the last output =0, Expressed as a natural constant.

[0067] In this embodiment, Sigmoid function is used for hidden layer neuron output. Its value range is (0,1). It can map a real number to the interval (0,1) and can be used for binary classification. It works better when the feature difference is complex or not very large. Sigmoid function is the activation function in neural network. It is a smooth and strictly monotonic saturation function. The specific expression is: .

[0068] In this embodiment, in the multi-layer GRU self-attention model, the parameters of each layer will affect the input of the next layer. For example, if the neurons of the parameters of the first layer are set to 5, the output of the next layer is a negative value, resulting in information loss or distortion during the transmission process.

[0069] The update gate controls the degree of information retention in the hidden state, while the reset gate affects the reception of new information. If the update gate tends to be closed (i.e., the parameters make the gate close to 0) and the reset gate tends to be open (i.e., the parameters make the gate close to 1), then the model may quickly forget old information and tend to rely on current input. If the update gate is almost always open (i.e., the parameters make the gate close to 1), then the hidden state may accumulate a lot of old information, which may cause the gradient to disappear or explode, making the model difficult to train. At this time, a reset gate is needed to control the entry of information flow. If both the update gate and the reset gate tend to be closed, then the hidden state may not obtain enough information from the new input, resulting in the model being unable to learn.

[0070] In the implementation of GRU, the update gate and the reset gate may share some parameters (such as some rows of the weight matrix), resulting in a parameter change of one gate directly affecting the behavior of the other gate. At different time steps, the behavior of the update gate and the reset gate may vary depending on the specific features of the input sequence. A small change in the parameters may lead to a significant change in the dynamic behavior between the two.

[0071] In this embodiment, financial time series analysis in the financial field may require a more complex gating mechanism to capture long-term dependencies due to the complexity of market dynamics. Therefore, the weight of the update gate may focus more on maintaining long-term memory. Financial data is very sensitive to time, so the gating parameters need to be refined in time so that the model can quickly adapt to sudden changes in the market. In the device monitoring of the Internet of Things, the gating mechanism is used to capture short-term data, so the weight of the reset gate is greater than the weight of the update gate. In the telecommunications field, both long-term and short-term data are needed, so the weights of the reset gate and the update gate need to be the same.

[0072] The difference between neurons in different fields needs to be divided according to the complexity of the data. The data in the financial field is too complex, so the overfitting problem is not given priority, and priority is given to increasing the number of neurons to capture market dynamics. In the field of equipment monitoring in telecommunications and the Internet of Things, overfitting is given priority, and the number of neurons is reduced when overfitting occurs.

[0073] In the financial field, neurons are mostly composed of the length of the timing window, risk sensitivity threshold, and market seasonality and cyclical parameters. In the telecommunications field, neurons are mostly composed of transmission frequency, network congestion rate, and mobile management parameters. In the field of device monitoring in the Internet of Things, neurons are mostly composed of data transmission efficiency, temperature compensation correction value, and device sensitivity.

[0074] The specific formula for the evaluation coefficient of the time series feature state tree is:

[0075] ;

[0076] In the formula, It is expressed as the evaluation coefficient of the time series feature state tree construction, which refers to the evaluation value of the quality of the isolation forest tree construction using the time series feature state. is represented by the number of trees in the isolation forest, It is represented by the number of samples drawn when training each tree. Expressed as the expected proportion of outliers in the data set, It is expressed as the number of features when finding the split point, It is expressed as the number of jobs running in parallel, and e is a natural constant.

[0077] In a specific embodiment, the time series feature state tree building evaluation coefficient data example is as follows:

[0078] Table 1 Example table of evaluation coefficient data for time series feature state tree building:

[0079] ;

[0080] like Figure 4 As shown, an image of the evaluation coefficient of the time series feature state tree in a secure hierarchical federated learning method based on isolation forest anomaly detection provided by an embodiment of the present application is provided. Figure 4 From the data in Table 1, it can be seen that when the number of trees in the isolation forest, the number of samples extracted when training each tree, the number of features when finding split points, and the number of jobs running in parallel are fixed, the larger the expected proportion of outliers in the data set, the lower the evaluation coefficient of the time series feature state tree building.

[0081] In this embodiment, the feature extraction output by the GRU self-attention model is used as the input feature of the isolation forest, so the parameters in the calculation formula of the anomaly evaluation coefficient of the comprehensive extraction of the time series feature state can affect the parameters in the evaluation coefficient of the time series feature state tree construction. For example, the more the total number of GRU layers, the more trees there are in the isolation forest, the more jobs running in parallel, and the more neurons in each GRU layer. The more samples are extracted when training the tree, and the greater the expected proportion of outliers in the data set. Moreover, since the expected proportion of outliers in the data set is greater, the difference between the accuracy of the aggregated global model and 1 is also greater, resulting in a decrease in the effect of model aggregation and a decrease in the anomaly detection ability of the model.

[0082] The number of samples extracted when training each tree varies with different fields. In the financial field, the number of samples extracted when training each tree is composed of transaction amount, transaction frequency, account balance and historical behavior score. In the field of IoT devices, the number of samples extracted when training each tree is composed of sensor data, device operating status and spatial distribution of devices. In the field of telecommunications, the number of samples extracted when training each tree is composed of network traffic, number of communications, signal strength and signal interference.

[0083] The specific method for obtaining the difference between the accuracy of the aggregated global model and 1 is:

[0084] ;

[0085] In the formula, It is expressed as the difference between the accuracy of the aggregated global model and 1, which refers to the degree of perfection of the aggregated global model. It is expressed as Actor-Critic algorithm, is represented as model parameters, Expressed as the accuracy of the global model, Expressed as the recall of the global model, Represented as the number of local training iterations of the global model.

[0086] In this embodiment, a reinforcement learning method is used, through real-time interaction between the system and the environment, and the optimal personalized anomaly detection strength threshold in the current state is made for each edge server in each time slot according to the actual attack situation of the model on each edge server side. The threshold is further corrected, getting rid of the defects of the unified detection threshold and improving the accuracy of the global model.

[0087] In this embodiment, the difference between the accuracy of the aggregated global model and 1 is an evaluation indicator of the degree of perfection of the global model. The smaller the difference, the closer the accuracy of the model is to perfection and the stronger the anomaly detection capability of the model. The larger the difference, the more flawed the accuracy of the model and the worse the anomaly detection capability of the model. At the same time, by observing the difference between the accuracy and 1, the threshold of anomaly detection can be adjusted to balance the false alarm rate and the missed alarm rate. For example, in financial fraud detection, a small difference may mean that a stricter threshold can be set to reduce false alarms. If the difference between the accuracy and 1 no longer decreases significantly during the training process, you can consider using an early stopping strategy to avoid overfitting. At the same time, the difference can predict whether more computing resources are needed to further optimize the model.

[0088] The Actor-Critic algorithm is a reinforcement learning method that combines policy iteration and value iteration. It is usually used to cope with the challenges of continuous action space and high-dimensional state space. The algorithm consists of two parts: the Actor network and the Critic network: the Actor network takes the state of the environment as input and outputs the probability distribution of performing each action in a given state. The Critic network evaluates the value of the action in a given state and is used to estimate the quality of the action selected by the policy network. Actor-Critic uses the policy gradient method to update the policy network. During the model training process, the training target is the optimal decision threshold.

[0089] In a specific embodiment, the Actor-Critic algorithm can be implemented by the following specific code:

[0090] import numpy as np

[0091] import matplotlib.pyplot as plt

[0092] import gym

[0093] import torch

[0094] from RL_brain import ActorCritic

[0095] num_episod edge servers = 100 # Total number of iterations

[0096] gamma = 0.9 # discount factor

[0097] actor_lr = 1e-3 # learning rate of the policy network

[0098] critic_lr = 1e-2 # learning rate of the value network

[0099] n_hiddens = 16 # Number of neurons in the hidden layer

[0100] env_name = 'CartPole-v1'

[0101] return_list = [] # Save the return of each round

[0102] env = gym.make(env_name, render_mode="human")

[0103] n_stat edge server = env.observation_space.shape[0] # Number of states

[0104] n_actions = env.action_space.n # Number of actions

[0105] agent = ActorCritic(n_stat edge server = n_stat edge server, # number of states

[0106] n_hiddens=n_hiddens, # Number of hidden layers

[0107] n_actions=n_actions, # number of actions

[0108] actor_lr=actor_lr, # Strategy network learning rate

[0109] critic_lr=critic_lr, # value network learning rate

[0110] gamma=gamma) # discount factor

[0111] for i in range(num_episod edge servers)

[0112] state = env.reet()[0] # Environment reset

[0113] done = False # Task completed

[0114] episode_return = 0 # Accumulate reward for each round

[0115] # Construct a data set to save the status data of each round

[0116] transition_dict = {

[0117] 'stat edge servers': [],

[0118] 'actions': [],

[0119] 'next_stat edge server': [],

[0120] 'rewards': [],

[0121] 'don edge server': [],

[0122] }

[0123] while not done:

[0124] action = agent.take_action(state) # Action selection

[0125] next_state, reward, done, _, _ = env.step(action) # Environment update

[0126] transition_dict['stat edge server'].append(state)

[0127] transition_dict['actions'].append(action)

[0128] transition_dict['next_stat'].append(next_state)

[0129] transition_dict['rewards'].append(reward)

[0130] transition_dict['don edge server'].append(done)

[0131] state = next_state

[0132] episode_return += reward

[0133] return_list.append(episode_return)

[0134] agent.update(transition_dict)

[0135] print(f'iter:{i}, return:{np.mean(return_list[-10:])}')

[0136] plt.plot(return_list)

[0137] plt.title('return')

[0138] plt.show()

[0139] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0143] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0144] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A secure hierarchical federated learning method based on isolation forest anomaly detection, characterized in that: The following steps are involved: S1. Obtain and initialize global model parameters on the cloud server and distribute them to the edge server, which then distributes them to the mobile device. The mobile device directly obtains the local data set of the global model parameters from the database. The mobile device uses the local data set to update the global model parameters and uploads the updated global model parameters to the edge server. S2. A GRU self-attention model is established on the edge server. The updated global model parameters on the edge server are extracted through the GRU self-attention model to extract the time series feature state, and the extraction abnormality evaluation coefficients of the time series feature states at different model levels are obtained. The edge server aggregates the GRU self-attention model using the federated average algorithm to obtain the aggregated GRU self-attention model. The isolated forest algorithm is used to build a tree of the time series feature states of the aggregated GRU self-attention model update parameters to obtain the time series feature state tree building evaluation coefficient, and the abnormality detection strength threshold after the aggregation of the GRU self-attention model parameters is directly obtained from the database. S3. By analyzing the comprehensive extraction anomaly evaluation coefficient of the time series feature state and the time series feature state tree construction evaluation coefficient, an anomaly detection strength evaluation coefficient is obtained to identify abnormal updates, and the anomaly detection strength evaluation coefficient is compared with the anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, and measures such as adaptively adjusting the anomaly detection strength or issuing an alarm are taken according to the comparison results; The specific extraction process of the updated global model parameters on the edge server extracting the temporal feature state through the GRU self-attention model is: The updated model parameters uploaded by the mobile device are transmitted to the self-attention model GRU on the edge server side. The GRU self-attention model is used to extract the temporal feature states of the original parameters for each layer of the model parameters, and the output is taken in units of model levels to obtain the extraction anomaly assessment coefficients of the temporal feature states of different model levels. The extraction anomaly assessment coefficients of the temporal feature states of different model levels are combined to obtain the comprehensive extraction anomaly assessment coefficient of the temporal feature states.

2. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific updating process of the mobile device using the local data set to update the global model parameters is as follows: The mobile device calculates the loss value of each round of training. The mobile device uses the stochastic gradient descent method to update the gradient in a random selection manner to minimize the loss function of the training data, and updates the model parameters through continuous iteration to obtain the updated model parameters.

3. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific aggregation process of the edge server using the federated average algorithm to aggregate the GRU self-attention model is: The mobile device uploads the updated model parameters to the edge server. The edge server assigns a weight to each client's update based on the amount of data from each client, sums up the weighted updates of all clients, and adds the result of the sum of the weighted updates of all clients to the global model parameters to obtain new global model parameters.

4. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific tree construction process of using the isolation forest algorithm to construct a tree for the time series feature state of the aggregated GRU self-attention model update parameters is as follows: Randomly select a sample from the local dataset as a subset, select a feature and a random value of the feature as the split point, divide the subset into two parts, repeat the split step until the size of the subset is reduced to 1 or reaches the preset tree depth limit, and randomly select multiple samples as trees in the isolation forest.

5. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific comparison process of comparing the anomaly detection strength evaluation coefficient and the anomaly detection strength threshold after the aggregation of the GRU self-attention model parameters is: The anomaly detection strength threshold after the GRU self-attention model parameters are aggregated is divided into a first anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, a second anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, and a third anomaly detection strength threshold after the GRU self-attention model parameters are aggregated. If the anomaly detection strength evaluation coefficient is less than or equal to the first anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, the security monitoring of the edge server is strengthened according to the anomaly detection strength evaluation coefficient, and the communication between the client and the edge server is encrypted using a security protocol. If the anomaly detection strength evaluation coefficient is less than or equal to the second anomaly detection strength threshold after the GRU self-attention model parameters are aggregated and greater than the first anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, mutual authentication between the client and the server is implemented according to the anomaly detection strength evaluation coefficient, and the structure of the isolation forest model is adjusted according to the detection requirements. If the anomaly detection strength evaluation coefficient is less than or equal to the third anomaly detection strength threshold after the GRU self-attention model parameters are aggregated and greater than the second anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, the heterogeneity of the client data is processed according to the anomaly detection strength evaluation coefficient. If the anomaly detection strength evaluation coefficient is greater than the third anomaly detection strength threshold after the GRU self-attention model parameters are aggregated, an alarm is issued and relevant personnel are reminded.

6. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The global model parameters include: GRU self-attention model parameters: number of GRU layers, number of neurons in each layer, activation function, activation function of gates, activation function of hidden states, and whether to return all outputs of a sequence or only the last output; Isolation Forest algorithm parameters: the number of trees in the isolation forest, the number of samples drawn when training each tree, the expected proportion of outliers in the dataset, the number of features when finding split points, and the number of jobs to run in parallel.

7. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific construction process of the GRU self-attention model is: Initialize a GRU network and design the network structure of the GRU, including the number of GRU layers, the number of neurons in each layer, the activation function, the activation function of the gate, the activation function of the hidden state, and whether to return all outputs of the sequence or only the last output. After the GRU layer, design a multi-head attention mechanism, establish independent weight matrices in multiple parallel attention layers, calculate the linear transformation of queries, keys, and values ​​in independent weight matrices, analyze the dot product of queries and keys through the softmax function to obtain the attention weight, multiply the attention weight by the value and sum them to obtain the output of the self-attention layer, combine the GRU layer and the self-attention layer to form an end-to-end GRU self-attention model.

8. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific adjustment method of adaptively adjusting the abnormality detection strength according to the comparison result is: Adaptive adjustment of anomaly detection strength includes processing the heterogeneity of client data, strengthening security monitoring on the edge server side, using security protocols to encrypt communications between the client and edge server, implementing mutual authentication between the client and server, and adjusting the structure of the isolation forest model according to detection requirements.

9. A secure hierarchical federated learning method based on isolation forest anomaly detection as claimed in claim 1, characterized in that: The specific method for obtaining the abnormal detection strength evaluation coefficient is: ; In the formula, Expressed as the anomaly detection strength assessment coefficient, It is expressed as the evaluation coefficient of building a tree for the time series feature state, Represents the weight factor for the evaluation coefficient of the time series feature state tree, Expressed as the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the weight factor of the comprehensive extraction anomaly assessment coefficient of the time series feature state, It is expressed as the difference between the accuracy of the aggregated global model and 1. The weight factor expressed as the difference between the accuracy of the aggregated global model and 1, Expressed as a natural constant.

Citation Information

Patent Citations

  • A method and system for detecting outlier nodes in federated learning

    CN112749392B

  • Federal learning-based power data anomaly detection method

    CN116451117A

  • Defense method for federal learning poisoning attack based on isolated forest

    CN114565106A

  • Method and apparatus for detecting ami network intrusion, and medium

    WO2023159812A1