Improved federal learning intrusion detection framework and method for industrial Internet of Things
By constructing an improved federated learning intrusion detection framework in the Industrial Internet of Things (IIoT), and utilizing a trust-weighted update strategy and cosine similarity calculation, the problem of malicious clients interfering with model aggregation is solved, thereby achieving model robustness and data privacy protection, and enhancing network security.
Patent Information
- Application Number
- CN202511402471.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-02-10
AI Technical Summary
In the Industrial Internet of Things (IIoT), the distributed nature of federated learning systems makes them highly sensitive to malicious edge servers. Malicious clients may interfere with parameter aggregation by uploading tampered model parameters, causing the model to misdetect malicious industrial network traffic data and weakening network security protection capabilities.
By employing a multi-round iterative collaborative approach, the cloud server limits the impact of malicious models through a trust value weighted update strategy, constructs a global intrusion detection model, supports each edge server to independently process private data, utilizes a global model dynamic weighted update strategy, and combines cosine similarity to calculate trust values to suppress the impact of malicious clients.
It effectively identifies malicious clients, ensures the reliability of model updates, enhances the robustness and security of intrusion detection models in adversarial environments, and protects the data privacy of edge servers.
Smart Images

Figure CN121508891A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intrusion detection framework technology for the Industrial Internet of Things (IIoT), specifically to an improved federated learning intrusion detection framework and method for the IIoT. Background Technology
[0002] The Industrial Internet of Things (IIoT), as a core application of IoT technology in industrial manufacturing, provides efficient and intelligent solutions for traditional manufacturing by deeply integrating network, computing, and intelligent technologies. However, with the widespread integration of industrial systems and information technology, the IIoT faces severe security challenges, including network intrusion, data corruption, malware penetration, and system vulnerability exploitation. These security risks seriously restrict the reliable operation and intelligent development of the IIoT. Against this backdrop, deploying efficient Intrusion Detection Systems (IDS) has become a key means of ensuring industrial network security. Traditional IDS rely on technologies such as machine learning, traffic feature analysis, and abnormal behavior detection, which can largely identify and defend against external attacks, improving overall system security.
[0003] In recent years, federated learning, as an emerging distributed machine learning paradigm, has been widely applied to collaborative network intrusion detection in the Industrial Internet of Things (IIoT). A typical federated learning process includes: a server distributing a global model to each client; clients fine-tuning the model based on local data and calculating updates; and the server aggregating the local updates to generate a new generation of the global model. Intrusion detection systems based on federated learning not only reduce the server load but also ensure data privacy protection through a decentralized local training mechanism.
[0004] However, the distributed nature of federated learning systems makes them highly sensitive to malicious edge servers. In the Industrial Internet of Things (IIoT) environment, malicious edge servers or clients may upload tampered model parameters, interfering with parameter aggregation and causing the model to misdetect malicious industrial network traffic data, thus weakening the network security protection capabilities for the IIoT. Therefore, building a federated learning framework that can effectively identify malicious clients and ensure the reliability of model updates has become a critical issue that urgently needs to be addressed in the field of IIoT intrusion detection. Summary of the Invention
[0005] To address the problems existing in the background technology, this invention proposes an improved federated learning intrusion detection framework and method for the Industrial Internet of Things (IIoT). It utilizes multiple industrial edge servers to construct a global intrusion detection model and supports each edge server to independently process private data, effectively mitigating the risk of leakage of sensitive industrial information. The dynamic weighted update strategy of the global model limits the impact of malicious models, thereby ensuring the robustness of the framework.
[0006] To achieve the above objectives, the present invention adopts the following solution: An improved federated learning intrusion detection method for the Industrial Internet of Things (IIoT) is proposed, wherein the method is executed collaboratively by a cloud server and multiple edge servers through multiple rounds of iteration, comprising the following iterative steps: Step 1: The cloud server distributes the global model parameters for the current round to the multiple edge servers; Step 2: After receiving the global model parameters, each edge server initializes its local model, trains the local model locally based on its local dataset, obtains the local model update quantity, and uploads it to the cloud server. Step 3: The cloud server calculates the ideal model update amount based on the pre-collected verification dataset and determines the actual model update amount based on all received local model update amounts. Step 4: For each local model update, the cloud server calculates its similarity to the ideal model update and the actual model update, and calculates the trust value of the local model update based on the similarity. Step 5: The cloud server uses the trust value as a weight to perform weighted aggregation and averaging of all local model update amounts to obtain the global model update amount, and uses the global model update amount to update the global model. The loop steps are repeated until the global model reaches the expected intrusion detection accuracy. The updated global model is distributed to each edge server after each iteration for local training in the next round. Optionally, in step 2, the local training step includes: the edge server initializing its local model parameters based on the received global model parameters, and iteratively optimizing it based on the local dataset by minimizing the loss function and using a stochastic gradient descent algorithm. The edge server updates the latest local model using the following formula: , In the formula, Indicates the edge server at the 1st The latest local model in each round of local training iterations; It is the learning rate of the local model; The loss function for the local dataset.
[0007] Optional, after After the first local iteration of training, update the local model size. The calculation is as follows: , In the formula, For the first Local model parameters after the next iteration; These are the global model parameters received in the current communication round.
[0008] Optionally, in step 3, the ideal model update amount It can be represented as: , In the formula, express The ideal model parameters after rounds of iteration; the actual model update amount is obtained by calculating the median of all local model update amounts.
[0009] Optionally, in step 4, the trust value calculation step includes: Step 4.1: Calculate the first similarity and the second similarity between the local model update and the ideal model update and the actual model update. The first similarity is expressed as: , The second similarity is represented as: , In the formula, and It is the first A local model Updated with the ideal model respectively Actual model update volume The cosine similarity value, Representing the The angle between the local model update direction and the collaborative base model update direction; Step 4.2: If the first similarity or the second similarity is negative, assign a zero value to its corresponding basic trust value. The first basic trust value corresponding to the first similarity... Represented as: , The second basic trust value corresponding to the second similarity Represented as: , Step 4.3: By weighted summation and fusion of the first and second basic trust values, the trust value of the local model update is obtained, expressed by the formula: , In the formula, Indicates local model update Trust value, This is a configurable trust value weighting coefficient.
[0010] Optionally, in step 5, the cloud server updates via aggregation using the following formula: , And update the global model using the following formula: , In the formula, Represents the total amount of global model updates; This represents the global learning rate.
[0011] An improved federated learning intrusion detection framework for the Industrial Internet of Things (IIoT) is provided to implement an improved federated learning intrusion detection method for the IIoT. The framework includes a device layer, an edge layer, and a cloud layer. The device layer comprises multiple IIoT terminal devices for collecting heterogeneous data and sending it to the edge layer. The edge layer is communicatively connected to the device layer and includes multiple edge servers for receiving the heterogeneous data and global model parameters, performing local model training, and uploading local model updates. The cloud layer is communicatively connected to the multiple edge servers and includes a cloud server that acts as a federated learning parameter server, collaboratively training the global intrusion detection model with the edge servers.
[0012] Optionally, the multiple edge servers communicate with the cloud server via a gRPC channel.
[0013] Optionally, the global intrusion detection model is a convolutional neural network model, whose structure includes two convolutional layers, one max pooling layer, and two fully connected layers, and employs batch normalization, sigmoid activation function, and dropout mechanism.
[0014] Optionally, the cloud server includes a model distribution module, a trust evaluation module, and a dynamic aggregation module. The model distribution module is used to distribute global model parameters to edge servers. The trust evaluation module is used to calculate the trust value of each local model update based on the ideal model update volume and the actual model update volume. The dynamic aggregation module is used to perform a weighted average of the local model update volumes with the trust value as the weight to generate and update the global model.
[0015] The beneficial effects of this invention are as follows: First, the detection method in this solution is applicable to industrial IoT environments with limited resources and heterogeneous data distribution. The global model dynamic weighted update strategy enables the model to continuously learn from new edge data and dynamically adapt to the ever-evolving network attack patterns.
[0016] Furthermore, this solution proposes an aggregation mechanism with trust values as weights. In each iteration, the server calculates a trust value for each local model update and uses it as a weight in the aggregation process. Then, the local model updates are aggregated into a global model update through weighted averaging. This limits the impact of malicious clients on the global aggregation and significantly enhances the robustness and security of the intrusion detection model in adversarial environments.
[0017] In addition, this solution supports each edge server to process private data independently, and only exchanges model parameter updates rather than the original data, which fully protects the privacy of the local data of each edge server node. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of the detection method of the present invention; Figure 2 This is a schematic diagram of the detection framework of the present invention. Detailed Implementation
[0019] To make the present invention clearer and more understandable, the present invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the given embodiments are only one implementation method and do not represent all embodiments.
[0020] Example 1 Combination Figure 1-2 This embodiment provides an improved federated learning intrusion detection method for the Industrial Internet of Things (IIoT). The method is executed collaboratively by a cloud server and multiple edge servers through multiple iterative rounds, including the following iterative steps: Step 1, Model Distribution: The cloud server establishes a secure communication channel with multiple edge servers via the network, initializes the intrusion detection model parameters and related training parameters, sets the total number of communication rounds, and distributes the global model parameters of the current round to each edge server.
[0021] Step 2, Local model training and uploading on edge servers: After receiving the global model parameters, each of the local edge servers initializes its local model, trains the local model locally based on its local dataset, obtains the local model update, and uploads it to the cloud server.
[0022] Assume there is a set of edge servers Each server Have local dataset resources The joint training dataset is represented as During the local training phase, each edge server In its local data resources Train a local intrusion detection model.
[0023] Therefore, the local training step includes: in the first... In round-robin communication, the edge server determines the parameters based on the received global model parameters. Initialize its local model parameters, and based on the local dataset. By minimizing the loss function The stochastic gradient descent (SGD) algorithm is used for iterative optimization, and the edge server updates the latest local model using the following formula: , In the formula, Indicates the edge server at the 1st The latest local model in each round of local training iterations; It is the learning rate of the local model. go through After the first local iteration of training, update the local model size. The calculation is as follows: , In the formula, For the first Local model parameters after the next iteration; These are the global model parameters received in the current communication round. In an industrial intrusion detection system (IDS), this represents the number of local training iterations. This determines the model's ability to capture potential patterns and dynamics of normal and abnormal system behavior.
[0024] Subsequently, the locally trained model updates its parameters. After being uploaded to the cloud server, the cloud server aggregates the local model update parameters uploaded from each edge server and generates a new global model according to the aggregation rules. Traditional federated learning aggregation methods are highly vulnerable to poisoning attacks launched by malicious clients at this stage. Maliciously uploaded model updates can interfere with the update direction of the global model, leading to decreased model performance or inaccurate detection. When dealing with such attacks, if a strategy of simply removing updates from suspected malicious clients is adopted, benign clients may be misjudged as malicious, while truly malicious clients may be missed, causing interference with model updates or even allowing the model to fall into the attacker's control.
[0025] This embodiment innovatively proposes an aggregation rule based on trust weights (the specific implementation of which will be described in detail in subsequent steps). The core of this aggregation rule is that in each iteration, the server calculates a trust value for each local model update and uses it as a weight in the aggregation process. Then, the local model updates are aggregated into a global model update by weighted averaging, thereby limiting the impact of malicious clients on the global aggregation.
[0026] Step 3, Determine the trust baseline: The cloud server calculates the ideal model update amount based on the pre-collected verification dataset, and determines the actual model update amount based on all received local model update amounts.
[0027] When data generally follows an independent and identically distributed (IOD) model parameter update pattern, the similarity between model parameter updates generated by malicious and benign clients is significantly lower than the similarity between parameter updates within a benign client group. Based on this similarity, the trust value of a client is quantified. This embodiment establishes two trust benchmarks: one is the ideal model update obtained by training a pre-collected auxiliary verification dataset; the other is the actual model update obtained from the local models of all edge servers. The ideal model update prevents malicious edge servers from influencing the intrusion detection model, while the actual model update ensures the timeliness of the detection model updates and reduces the global model's dependence on the pre-collected verification dataset.
[0028] Therefore, in each round of global model communication iteration, the cloud server, based on the received local model updates, uses these two trust benchmarks. Specifically, firstly, the cloud server updates the local intrusion detection model uploaded by each edge server. Respectively compared with the update amount of the ideal model To perform similarity assessment, the cloud server verifies the dataset. Upward The ideal model is obtained through rounds of iterative training; the ideal model update volume. It can be represented as: , in, express The ideal model parameters after rounds of iteration.
[0029] Secondly, to reflect the true update status of most edge servers currently participating in training, the cloud server simultaneously determines the actual update direction of the edge servers by calculating all received local model update amounts. The median is used to characterize it.
[0030] Step 4, Calculate the trust value: For each local model update, the cloud server calculates its similarity with the ideal model update and the actual model update, and calculates the trust value of the local model update based on the similarity.
[0031] This step involves a similarity assessment based on a trust benchmark to distinguish between benign and malicious model updates. The higher the similarity between the direction of the local model update and the directions of the ideal and actual model updates, the more trustworthy the model is. This step ensures that the edge server can still effectively perform detection tasks when subjected to poisoning attacks and reduces the dependence on pre-collected datasets, enabling the framework to adapt more effectively to dynamic attack scenarios.
[0032] Specifically, in this embodiment, cosine similarity is used to quantify the directional similarity between the local model update on the edge server and the ideal and actual model updates. The trust value calculation step includes: Step 4.1: Calculate the first similarity and the second similarity between the local model update and the ideal model update and the actual model update. The first similarity is expressed as: , The second similarity is represented as: , In the formula, and It is the first A local model Updated with the ideal model respectively Actual model update volume The cosine similarity value, Representing the The angle between the local model update direction and the collaborative base model update direction.
[0033] Step 4.2: If the first or second similarity score is negative, it means there is an anomaly in the local model update. Therefore, the corresponding base trust value is assigned to zero. The first basic trust value corresponding to the first similarity It can be represented as: , The second basic trust value corresponding to the second similarity Represented as: , Step 4.3: By weighted summation and fusion of the first and second basic trust values, the trust value of the local model update is obtained, expressed by the formula: , In the formula, Indicates local model update Trust value, This is a configurable trust value weighting coefficient. Typically, the direction of updates from a benign local model is closer to the desired model update direction, and its value is greater than that of updates from malicious edge servers. This constrains the influence of malicious edge servers on the global model update direction.
[0034] Step 5, Dynamic Aggregation and Model Update: The cloud server uses the trust value as a weight to perform weighted aggregation and averaging of all local model update amounts to obtain the global model update amount, and uses this global model update amount to update the global model.
[0035] This step obtains a robust intrusion detection model by dynamically aggregating local models. Specifically, the cloud server uses a weighted average method to aggregate all local model updates, where the update amount for each local model is... The weighting coefficient is the confidence value calculated in step four. Aggregate to generate global model update volume The calculation formula is as follows: , This dynamic weighting mechanism ensures that benign edge servers with higher trust values contribute more to the direction of global model updates, thereby effectively suppressing malicious or abnormal updates from interfering with the global model.
[0036] Subsequently, the cloud server updates the weights and global learning rate based on the current round's weights. Update global model parameters as follows: , Once the global model update is complete, the cloud server will update the model parameters. The new global model is distributed to each edge server to initiate the next training iteration. Each edge server receives the new global model and uses it as initial parameters to continue training using local site-specific data until high-precision intrusion or anomaly detection is achieved in network traffic. This process of updating the global model, distributing it to edge sites, and further training to optimize the local model is repeated until all devices in the industrial network reach the expected detection accuracy. When the global model is on the validation set... A score > 0.95 indicates that the global model has reached the expected accuracy, as expressed by the formula: , in This refers to correctly identifying malicious data. This refers to misclassifying normal data as malicious data. This refers to misclassifying malicious data as normal data.
[0037] Example 2 Combination Figure 2 This embodiment provides an improved federated learning intrusion detection framework for the Industrial Internet of Things (IIoT), which implements the detection method in Embodiment 1. Federated learning requires a deep learning runtime environment for training, which consumes significant computing power in addition to storage space and memory. Currently, resource-constrained IIoT devices cannot provide sufficient computing power. Therefore, edge servers are selected as federated clients, and cloud servers are selected as federated parameter servers, both with identical neural network model structures. The core idea of the framework is that multiple edge servers jointly construct a federated learning intrusion detection system and design a dynamic model update strategy based on cosine similarity calculation.
[0038] Specifically, the framework includes a device layer, an edge layer, and a cloud layer. The device layer includes multiple industrial IoT terminal devices for collecting heterogeneous data and sending it to the edge layer. The edge layer is communicatively connected to the device layer and includes multiple edge servers for receiving global model parameters from the cloud server; training the global model based on a local dataset to obtain local model updates; and uploading the local model updates to the cloud server. The cloud layer is communicatively connected to the multiple edge servers and includes a cloud server for executing the model distribution step, the receiving step, the trust benchmark determination step, the trust value calculation step, and the weighted aggregation and update step to collaboratively train the global intrusion detection model.
[0039] Specifically, the multiple edge servers communicate with the cloud server via gRPC channels. The global intrusion detection model is a convolutional neural network model, whose structure includes two convolutional layers, one max-pooling layer, and two fully connected layers, and employs batch normalization, the sigmoid activation function, and the dropout mechanism.
[0040] Furthermore, the cloud server includes a model distribution module, a trust evaluation module, and a dynamic aggregation module. The model distribution module is used to distribute global model parameters to edge servers. The trust evaluation module is used to calculate the trust value of each local model update based on the ideal model update amount and the actual model update amount. The dynamic aggregation module is used to perform a weighted average of the local model update amounts with the trust value as the weight to generate and update the global model.
[0041] Therefore, the detection framework utilizes multiple industrial edge servers to build a global intrusion detection model, and supports each edge server to independently process private data, effectively mitigating the risk of sensitive industrial information leakage. The global model's dynamic weighted update strategy limits the impact of malicious models, thereby ensuring the framework's robustness.
[0042] The specific embodiments of the present invention have been described in detail above with reference to the figures, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.
Claims
1. An improved federated learning intrusion detection method for the Industrial Internet of Things, characterized in that, The method is executed collaboratively by a cloud server and multiple edge servers through multiple iterative rounds, including the following cyclical steps: Step 1: The cloud server distributes the global model parameters for the current round to the multiple edge servers; Step 2: After receiving the global model parameters, each edge server initializes its local model, trains the local model locally based on its local dataset, obtains the local model update quantity, and uploads it to the cloud server. Step 3: The cloud server calculates the ideal model update amount based on the pre-collected verification dataset and determines the actual model update amount based on all received local model update amounts. Step 4: For each local model update, the cloud server calculates its similarity to the ideal model update and the actual model update, and calculates the trust value of the local model update based on the similarity. Step 5: The cloud server uses the trust value as a weight to perform weighted aggregation and averaging of all local model update amounts to obtain the global model update amount, and uses the global model update amount to update the global model. The cyclical steps are repeated until the global model reaches the expected intrusion detection accuracy. The updated global model is distributed to each edge server after each iteration for local training in the next round.
2. The improved federated learning intrusion detection method for the Industrial Internet of Things according to claim 1, characterized in that: In step 2, the local training step includes: the edge server initializes its local model parameters based on the received global model parameters, and iteratively optimizes the model based on the local dataset by minimizing the loss function and using a stochastic gradient descent algorithm. The edge server updates the latest local model using the following formula: , In the formula, Indicates the edge server is in the The latest local model in each round of local training iterations; It is the learning rate of the local model; The loss function for the local dataset.
3. An improved federated learning intrusion detection method for the Industrial Internet of Things according to claim 2, characterized in that: go through After the first local iteration of training, update the local model size. The calculation is as follows: , In the formula, For the first Local model parameters after the next iteration; These are the global model parameters received in the current communication round.
4. An improved federated learning intrusion detection method for the Industrial Internet of Things according to claim 1, characterized in that: In step 3, the ideal model update amount It can be represented as: , In the formula, express The ideal model parameters after rounds of iteration; the actual model update amount is obtained by calculating the median of all local model update amounts.
5. An improved federated learning intrusion detection method for the Industrial Internet of Things according to claim 1, characterized in that: Step 4, the trust value calculation step includes: Step 4.1: Calculate the first similarity and the second similarity between the local model update and the ideal model update and the actual model update. The first similarity is expressed as: , The second similarity is represented as: , In the formula, and It is the first A local model Updated with the ideal model respectively Actual model update volume The cosine similarity value, Representing the The angle between the local model update direction and the collaborative base model update direction; Step 4.2: If the first similarity or the second similarity is negative, assign the corresponding basic trust value to zero. The first basic trust value corresponding to the first similarity... Represented as: , The second basic trust value corresponding to the second similarity Represented as: , Step 4.3: By weighted summation and fusion of the first and second basic trust values, the trust value of the local model update is obtained, expressed by the formula: , In the formula, Indicates local model update Trust value, This is a configurable trust value weighting coefficient.
6. An improved federated learning intrusion detection method for the Industrial Internet of Things according to claim 1, characterized in that: In step 5, the cloud server updates via aggregation using the following formula: , And update the global model using the following formula: , In the formula, Represents the total amount of global model updates; This represents the global learning rate.
7. An improved federated learning intrusion detection framework for the Industrial Internet of Things, characterized in that: The framework is used to implement an improved federated learning intrusion detection method for the Industrial Internet of Things (IIoT) as described in any one of claims 1-6, comprising a device layer, an edge layer, and a cloud layer; the device layer includes multiple IIoT terminal devices for collecting heterogeneous data and sending it to the edge layer; the edge layer is communicatively connected to the device layer and includes multiple edge servers for receiving the heterogeneous data and global model parameters, performing local model training, and uploading local model updates; the cloud layer is communicatively connected to the multiple edge servers and includes a cloud server for acting as a federated learning parameter server, collaboratively training the global intrusion detection model with the edge servers.
8. An improved federated learning intrusion detection framework for the Industrial Internet of Things according to claim 7, characterized in that: The multiple edge servers communicate with the cloud server via gRPC channels.
9. An improved federated learning intrusion detection framework for the Industrial Internet of Things according to claim 7, characterized in that: The global intrusion detection model is a convolutional neural network model, which includes two convolutional layers, one max pooling layer and two fully connected layers, and employs batch normalization, sigmoid activation function and dropout mechanism.
10. An improved federated learning intrusion detection framework for the Industrial Internet of Things according to claim 7, characterized in that: The cloud server includes a model distribution module, a trust evaluation module, and a dynamic aggregation module. The model distribution module is used to distribute global model parameters to edge servers. The trust evaluation module is used to calculate the trust value of each local model update based on the ideal model update amount and the actual model update amount. The dynamic aggregation module is used to perform a weighted average of the local model update amount using the trust value as the weight, and generate and update the global model.