A Low-Missing-Return Federated Intrusion Detection Method Based on Category Consensus
By constructing a global category distribution prior and generating pseudo-features using a condition generator, and combining scale-aware meta-distillation training and adaptive hierarchical Top-S aggregation, the problem of high false negative rate for tail attack categories in IoT federated intrusion detection is solved. This achieves efficient category consensus propagation and model aggregation, improving detection performance and recall.
Patent Information
- Application Number
- CN202611050379.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-11-17
AI Technical Summary
Existing IoT federated intrusion detection methods suffer from several problems under non-independent identically distributed and long-tailed category distributions, including high false negative rates for tail attack categories, difficulty in propagating global category consensus, difficulty in adapting distillation constraints to differences in client data scale, and susceptibility of the aggregation process to low-quality local models.
By constructing a global category distribution prior and using a condition generator to generate category-controllable pseudo-features, combined with scale-aware meta-distillation training and adaptive hierarchical Top-S aggregation, an adaptive balance between global knowledge supplementation and local adaptation is achieved, reducing the false negative rate of tail attack categories.
Without sharing raw data, it significantly reduces the false negative rate of tail attack categories, improves the recall rate and overall detection performance of the federal intrusion detection system, and balances privacy protection and detection performance.
Smart Images

Figure CN123122866A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of artificial intelligence, cybersecurity, and federated learning technologies, and specifically relates to a low-false-miss federated intrusion detection method based on category consensus. Background Technology
[0002] With the rapid expansion of the number of IoT devices and application scenarios, the scale of traffic data generated in the network environment is constantly growing, and attack types are becoming increasingly complex. Intrusion detection systems (IDS) can identify potential attacks by analyzing network traffic and system behavior, and are an important means to ensure the secure operation of IoT systems. Traditional rule-based or feature-matching-based intrusion detection methods rely on human experience and known attack characteristics, making it difficult to effectively deal with constantly evolving unknown and complex attacks. While deep learning-based intrusion detection methods can automatically extract traffic features and improve detection accuracy, they typically rely on centralized training, requiring the uploading of raw traffic data distributed across edge devices to a central server, which poses privacy risks and incurs high communication and computational overhead.
[0003] Federated learning provides a privacy-preserving collaborative training scheme for IoT intrusion detection. Each client trains its model locally using private network traffic data, uploading only model parameters or updates. A central server aggregates these data to obtain a global model, thus avoiding direct sharing of raw data. However, in real-world IoT scenarios, local data from different edge devices often exhibits significant non-independent and identically distributed characteristics due to variations in deployment environment, business functions, communication modes, and attack types. Furthermore, real-world network traffic typically has a long-tailed category distribution, meaning that normal traffic samples constitute a large proportion, while some attack categories have fewer samples or are even missing in some clients. These factors cause local models to favor high-frequency categories or locally dominant categories. After global aggregation, this category bias is further amplified, resulting in insufficient ability to identify tail-end attack categories and a few other attack categories, leading to a high false negative rate.
[0004] Existing personalized federated learning methods typically mitigate the performance degradation caused by non-independent and identically distributed data by limiting local model update offsets, correcting client drift, or adjusting aggregation weights. However, they do not adequately address the issues of long-tail attack categories and minority class false negatives in intrusion detection scenarios. Some knowledge distillation-based federated learning methods rely on public datasets or server-side proxy datasets, making it difficult to obtain high-quality proxy data consistent with real network traffic distribution in IoT scenarios with strict privacy constraints. While data-free distillation methods can generate pseudo-samples or pseudo-features using generators, they often do not fully consider the differences in data scale among different clients. Using a uniform distillation intensity can easily lead to insufficient global knowledge supplementation for small-scale clients, or excessive external constraints on large-scale clients, weakening their local adaptability.
[0005] Furthermore, traditional federated aggregation methods typically use weighted averages of model parameters based on the number of client samples, lacking effective discernment of client model distribution structure and quality. Under the combined influence of non-independent identically distributed (i.i.d.) and long-tailed class distributions, some clients may produce low-quality local updates due to small data size, insufficient class coverage, or low data quality. If such updates participate in aggregation without screening, they will negatively interfere with the global model, reducing its detection performance. Existing clustering aggregation methods usually require pre-setting the number of clusters, making it difficult to adapt to the dynamically changing model distribution structure during federated training, and also lacking an effective mechanism for screening representative models within clusters.
[0006] Therefore, existing federated intrusion detection methods for the Internet of Things (IoT) still suffer from problems such as high false negative rates for tail attack categories, difficulty in effectively transmitting global category consensus without sharing original data, difficulty in adapting distillation constraints to differences in client data scale, and susceptibility of the aggregation process to low-quality local models. There is an urgent need for a federated intrusion detection method that can balance privacy protection, category consensus utilization, local personalization adaptation, and high-quality model aggregation to improve the detection capability for a few attack categories and tail attack categories in complex and heterogeneous IoT environments. Summary of the Invention
[0007] The present invention aims to at least partially solve one of the technical problems in the related art.
[0008] Therefore, the first objective of this invention is to propose a low-false-miss federated intrusion detection method based on class consensus.
[0009] The second objective of this invention is to propose a low-miss-report federal intrusion detection system based on class consensus.
[0010] The third objective of this invention is to provide a computer device.
[0011] The fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0012] To achieve the above objectives, a first aspect of the present invention proposes a low-false-miss federated intrusion detection method based on category consensus, comprising:
[0013] S1, each client counts the number of samples of each category in the local network traffic dataset and uploads them to the central server. The central server constructs a global category distribution prior based on the category statistics uploaded by each client. S2, the central server initializes the global intrusion detection model and condition generator, and sends the current global intrusion detection model, condition generator, global category distribution prior, and total global sample size to each client; S3. After receiving the above information, each client performs scale-aware meta-distillation training: the inner layer is updated quickly to simulate the rapid adaptation of the local data distribution, and the outer layer is updated while introducing local supervision loss and distillation loss based on the category consensus pseudo-features generated by the condition generator. The trained local model is then uploaded to the central server. The weight of the distillation loss is adaptively calculated according to the local sample size of the client. S4, the central server uses the global category distribution prior and the classifiers in the local models uploaded by each client to train the condition generator, enabling it to generate category-controllable pseudo-features with global category consensus based on the given category label; S5, the central server performs adaptive hierarchical aggregation on the local models uploaded by each client: the local model parameters are normalized and represented, and then divided into multiple model clusters through parameterless clustering. Representative models are selected within each model cluster for intra-cluster aggregation, and then inter-cluster aggregation is performed on the representative models of each cluster to obtain the updated global intrusion detection model. S6, the central server sends the updated global intrusion detection model and condition generator to each client, repeating steps S3 to S5 until the preset global communication round is reached; S7. After completing all global communication rounds, the central server sends the final global intrusion detection model to each client. Each client then performs local customization fine-tuning of the final global intrusion detection model based on local network traffic data to obtain a customized intrusion detection model for local deployment.
[0014] In one embodiment of the present invention, the construction of the global category distribution prior includes: Each client counts the number of samples in each category locally, and the central server calculates the global category distribution prior based on the category statistics uploaded by all clients; The training of the condition generator includes: the central server samples category labels based on the global category distribution prior, combines random noise input to the condition generator to generate pseudo features, inputs the pseudo features into the classifiers in the local models uploaded by each client, weights and aggregates the outputs of each classifier according to the client sample size, and optimizes the generator training loss by using the cross-entropy between the weighted aggregation result and the sampled category labels.
[0015] In one embodiment of the present invention, the scale-aware meta-distillation training includes: The client uses the global intrusion detection model as its local initial model, samples training batches from the local dataset, and divides them into support sets and query sets; A temporary model is obtained by performing an inner-layer fast adaptive update based on the support set; class labels are sampled based on the global class distribution prior, and class consensus pseudo-features are generated by combining random noise input condition generator; the pseudo-features are input into the classifier of the temporary model to calculate the distillation loss. Calculate the outer supervision loss of the temporary model on the query set; adaptively calculate the distillation weights based on the local sample size and the total global sample size; and weight the outer supervision loss and the distillation loss to obtain the outer update total optimization objective. Based on the overall optimization objective of the outer layer update, a meta-update is performed on the initial model to obtain the trained local model.
[0016] In one embodiment of the present invention, the adaptive hierarchical aggregation includes: The local model parameters uploaded by each client are flattened into model vectors and normalized; a parameter-free clustering method is used to adaptively cluster the normalized model vectors to obtain multiple model clusters. Within each model cluster, representative models are selected according to client aggregation weights. These representative models are then aggregated within the cluster to obtain cluster representative models. Finally, cluster representative models are aggregated between clusters to obtain the updated global intrusion detection model.
[0017] In one embodiment of the present invention, the local personalized fine-tuning includes: The client uses the final global intrusion detection model parameters as initialization parameters to perform supervised training on the local network traffic dataset, resulting in a local personalized intrusion detection model. This model is used to classify network traffic samples collected locally by the client and output either normal traffic categories or attack traffic categories.
[0018] To achieve the above objectives, a second aspect of the present invention proposes a low-false-miss federated intrusion detection system based on category consensus, comprising: The central server includes: The global prior construction module is used to construct a global category distribution prior based on the local category statistics information uploaded by each client; The condition generator training module is used to train the condition generator using the global class distribution prior and the classifiers in the local models uploaded by each client. The adaptive aggregation module is used to perform normalization, parameterless clustering, intra-cluster representative model selection, intra-cluster aggregation, and inter-cluster aggregation on the local models uploaded by each client to obtain the updated global intrusion detection model. And multiple clients deployed on IoT edge devices, each client including: The local statistics module is used to count the number of samples of each category in the local network traffic dataset and upload them to the central server; The scale-aware meta-distillation training module is used to simulate the rapid adaptation of local data distribution by quickly updating the inner layer, and then to conduct local training by updating the outer layer while introducing local supervision loss and distillation loss based on class consensus pseudo-features generated by the condition generator. The weight of the distillation loss is adaptively calculated according to the local sample size of the client. The local customization module is used to fine-tune the final global intrusion detection model based on local network traffic data after receiving it, so as to obtain a customized intrusion detection model for local deployment.
[0019] The low-false-miss federated intrusion detection method and apparatus based on category consensus according to an embodiment of the present invention has the following beneficial effects: First, a global category consensus transmission and utilization mechanism was constructed to achieve category knowledge sharing without sharing the original data. Each client only needs to upload category statistics to construct a global category distribution prior. The server then trains a condition generator to generate controllable pseudo-features for the categories, so that categories that are missing locally or have insufficient samples can still obtain global-level discriminative knowledge, avoiding distribution bias and privacy risks caused by introducing real proxy data.
[0020] Second, a scale-aware meta-distillation training method is proposed to achieve an adaptive balance between global knowledge supplementation and local adaptation. The inner layer quickly adapts to fit the local data distribution, while the outer layer update introduces both supervised loss and class consensus distillation loss. The distillation weights are adaptively calculated based on the local sample size of the client, so that small-scale clients obtain stronger external knowledge supplementation, while large-scale clients maintain sufficient local adaptation capabilities, thus mitigating the impact of data scale heterogeneity on training stability.
[0021] Third, an adaptive hierarchical Top-S aggregation strategy was designed to improve the aggregation quality and robustness of the global model. This strategy automatically identifies the model distribution structure through parameter-free clustering, avoiding the need for pre-setting the number of clusters. Representative models within each cluster are selected for aggregation, reducing the negative interference of low-quality, biased, or outlier models on the global model, thus making the aggregation results more reflective of the common knowledge of effective clients.
[0022] Fourth, a complete federated training process for IoT intrusion detection has been established, balancing privacy protection and detection performance. Based on a closed-loop architecture of "global prior construction - generator training - scale-aware distillation - hierarchical aggregation - local fine-tuning", it achieves collaborative optimization of category consensus transmission, local personalized adaptation, and high-quality global aggregation without requiring the original client data to leave the local machine. This significantly reduces the false negative rate of tail attack categories and improves the recall rate and overall detection performance of the federated intrusion detection system.
[0023] To achieve the above objectives, a third aspect of this application provides a computer device comprising a processor and a memory; wherein the processor runs a program corresponding to the executable program code stored in the memory, for implementing a low-miss-report federal intrusion detection method based on class consensus as described in the first aspect embodiment.
[0024] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a low-miss-report federal intrusion detection method based on class consensus as described in the first aspect.
[0025] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0026] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a low-false-miss federated intrusion detection method based on category consensus according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the server-side process according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the client training process according to an embodiment of the present invention; Figure 4 It is a computer device according to an embodiment of the present invention. Detailed Implementation
[0027] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0029] To address the aforementioned issues, the present invention aims to provide a low-miss-report federated intrusion detection method based on category consensus. This method is intended to alleviate category bias and tail attack misses caused by non-independent identically distributed data, long-tail category distribution, and differences in client model quality in IoT federated intrusion detection scenarios. Without sharing the original network traffic data of the client, it improves the ability of the federated intrusion detection model to identify a few attack categories and tail attack categories.
[0030] The following description, with reference to the accompanying drawings, describes a low-miss-report federal intrusion detection method and system based on category consensus, according to an embodiment of the present invention.
[0031] Example 1 Figure 1 This is a flowchart of a low-false-miss federated intrusion detection method based on category consensus according to an embodiment of the present invention, as follows: Figure 1 As shown, it includes: S1, each client counts the number of samples of each category in the local network traffic dataset and uploads them to the central server. The central server constructs a global category distribution prior based on the category statistics uploaded by each client. S2, the central server initializes the global intrusion detection model and condition generator, and sends the current global intrusion detection model, condition generator, global category distribution prior, and total global sample size to each client; S3. After receiving the above information, each client performs scale-aware meta-distillation training: the inner layer is updated quickly to simulate the rapid adaptation of the local data distribution, and the outer layer is updated while introducing local supervision loss and distillation loss based on the category consensus pseudo-features generated by the condition generator. The trained local model is then uploaded to the central server. The weight of the distillation loss is adaptively calculated according to the local sample size of the client. S4, the central server uses the global category distribution prior and the classifiers in the local models uploaded by each client to train the condition generator, enabling it to generate category-controllable pseudo-features with global category consensus based on the given category label; S5, the central server performs adaptive hierarchical aggregation on the local models uploaded by each client: the local model parameters are normalized and represented, and then divided into multiple model clusters through parameterless clustering. Representative models are selected within each model cluster for intra-cluster aggregation, and then inter-cluster aggregation is performed on the representative models of each cluster to obtain the updated global intrusion detection model. S6, the central server sends the updated global intrusion detection model and condition generator to each client, repeating steps S3 to S5 until the preset global communication round is reached; S7. After completing all global communication rounds, the central server sends the final global intrusion detection model to each client. Each client then performs local customization fine-tuning of the final global intrusion detection model based on local network traffic data to obtain a customized intrusion detection model for local deployment.
[0032] This invention provides a low-miss-report federated intrusion detection method based on category consensus, which can effectively reduce the false negative rate of tail attack categories in heterogeneous IoT environments and improve the recall rate, robustness, and overall detection performance of the federated intrusion detection system.
[0033] Example 2 The following describes in detail an embodiment of the present invention, a low-miss-report federal intrusion detection method based on category consensus, with reference to the accompanying drawings.
[0034] like Figure 2 and Figure 3 As shown, this invention provides a low-false-miss federated intrusion detection system based on category consensus. The system includes a central server and multiple clients deployed on IoT edge devices. Each client stores a local network traffic dataset and performs intrusion detection model training locally. The central server does not receive raw network traffic data from the clients, but only receives category statistics and local model parameters uploaded by the clients, which are used to construct a global category distribution prior, a training condition generator, and to perform global model aggregation.
[0035] Assuming a federal system has a total of One client, client The local network traffic dataset is represented as Each sample is composed of network traffic features. and category labels Composition. The global category set is denoted as... ,category This indicates whether the traffic is normal or a specific type of attack traffic. The client-side local intrusion detection model includes a feature extraction component and a classifier component, used to classify and identify network traffic samples.
[0036] The specific implementation process of this invention is as follows.
[0037] Step 1: Construct a global category distribution prior.
[0038] Before federated training begins, each client first counts the number of samples in each category within its local network traffic dataset. Traverse its local network traffic dataset Statistical categories Local sample size The calculation formula is:
[0039] in, Represents a sample of network traffic. Indicates the sample category label, This indicates an indicator function that takes the value 1 when the condition within the parentheses is true, and 0 otherwise.
[0040] Client Local statistical information for each category of samples is uploaded to the central server. The central server calculates the global category distribution prior based on the category statistical information uploaded by all clients. :
[0041] in, This indicates the number of clients participating in federated training. Indicates client The total number of local samples, , This represents the total global sample size of the federal system. Indicate category The proportion of empirical distribution in the overall data space of the federal system.
[0042] In this way, the central server can obtain the overall category statistical structure of the federated system without acquiring the client's raw network traffic data. This global category distribution prior is used for subsequent server-side generator training and client-side category consensus distillation, enabling clients with missing local categories or insufficient tail attack category samples to obtain supplementary constraints at the global category level.
[0043] Step 2: Initialize the global intrusion detection model and condition generator.
[0044] The central server initializes the global intrusion detection model parameters. and condition generator The condition generator This is used to generate category consensus pseudo-features for a given category label and random noise.
[0045] The input to the condition generator includes category labels. and random noise The output is a pseudo-feature of class consensus:
[0046] in, This represents random noise sampled from a Gaussian distribution. Indicates the condition generator parameters. This represents the generated category consensus pseudo-feature.
[0047] The central server sends the current global intrusion detection model, condition generator, global category distribution prior, and total global sample size to each client, enabling each client to train locally based on the global model and obtain category consensus pseudo-features using the condition generator.
[0048] Step 3: The client performs scale-aware meta-distillation training.
[0049] Client Receive global intrusion detection model parameters sent by the central server And use them as the initial model parameters for this round of local training. :
[0050] Client From local network traffic datasets The training batch is sampled and divided into support sets. and query set Among them, support sets Used to perform rapid adaptive updates of the inner query set. Used to calculate the outer layer supervision loss.
[0051] Client In support set The upper layer performs a fast adaptive update to obtain temporary model parameters. :
[0052] Where α represents the inner layer update learning rate. This indicates the loss of supervised training on the support set.
[0053] Subsequently, the client In query set Calculate temporary model parameters Corresponding outer supervision loss:
[0054] in, This indicates the client-side local intrusion detection model. This represents the cross-entropy loss function.
[0055] To introduce global class consensus constraints, the client... Based on global category distribution prior Sampling category labels and sample category labels With random noise Input condition generator Generate category consensus pseudo-features:
[0056] Client Class consensus pseudo-features Input the classifier corresponding to the temporary model, obtain the predicted output, and compare it with the sampled class labels. Calculate the consensus distillation loss for each category:
[0057] in, Indicates client The classifier in the local model.
[0058] Furthermore, client i adjusts the size based on the local sample size. Calculate the scale-aware distillation weights based on the total global sample size of the federated system. :
[0059] in, Represents the global distillation intensity coefficient. Indicates the lower limit of distillation weight. This indicates the upper limit of the distillation weight.
[0060] When the local sample size on the client is small Increasing the value provides stronger global category consensus constraints for smaller clients; however, when the client's local sample size is large, Decreasing the value reduces the interference of external distillation signals on local learning for large-scale clients.
[0061] Client Loss of outer layer supervision Consensus Distillation Loss By combining these methods, we obtain the overall optimization objective for the outer layer update:
[0062] Client i rolls back the model parameters to the initial model parameters. And perform a meta-update based on the overall optimization objective of the outer layer update:
[0063] in, This indicates the meta-updated learning rate.
[0064] Through the scale-aware meta-distillation training process described above, the client model can quickly adapt to the local network traffic distribution through support sets and query sets, and can also use the global category consensus pseudo-features provided by the condition generator to supplement the supervision information of local missing categories and tail attack categories, thereby alleviating the category bias caused by non-independent identically distributed data and long-tail category distribution.
[0065] After local training is complete, the client The trained local model parameters are uploaded to the central server.
[0066] Step 4: Train the condition generator on the server side.
[0067] After receiving the local model parameters uploaded by each client, the central server trains the condition generator using the global class distribution prior and the classifiers in each client's local model.
[0068] Specifically, the central server uses a priori global category distribution. Sample category labels in batches, and combine sample category labels with random noise input condition generators. The central server then inputs the class consensus pseudo-features into the classifiers uploaded to the local models of each client, thereby obtaining the prediction outputs of each client's classifier.
[0069] The central server determines the aggregation weights based on the client sample size. :
[0070] in, Indicates client The aggregate weights of the corresponding classifier output during generator training.
[0071] The central server performs weighted aggregation on the outputs of each client classifier, and uses the cross-entropy between the weighted aggregation prediction result and the sampled class label as the generator training loss.
[0072] in, Indicates client Upload the classifier from the model. Represents the cross-entropy loss function. This indicates the category label for the input condition generator.
[0073] By minimizing the generator training loss described above, the conditional generator can learn the common discriminative knowledge of different client models for each category, thereby generating category-controllable pseudo-features with global category consensus. This process does not require the server to access any raw network traffic data from the clients, reducing the risk of privacy leaks caused by raw data transmission.
[0074] Step 5: The server performs adaptive hierarchical Top-S aggregation.
[0075] After receiving the local model parameters uploaded by each client, the central server performs adaptive hierarchical Top-S aggregation on the local model to generate an updated global intrusion detection model.
[0076] First, the central server will connect the client. Uploaded local model parameters Flattened into a single model vector:
[0077] in, This indicates a parameter flattening operation.
[0078] Then, the central server processes the model vectors. conduct Normalization process:
[0079] All normalized model vectors are stacked into a model feature matrix. .
[0080] The central server will store the model feature matrix. Input a parameter-free clustering algorithm to perform clustering, and automatically obtain the number of model clusters. And the cluster label to which each local model belongs. Since this clustering process does not require pre-setting the number of clusters, it can adaptively divide model clusters according to the actual distribution structure of client models in the current communication round.
[0081] For the Let there be a model cluster, and let its contained client index set be denoted as . The central server aggregates weights based on client data. The models within the cluster are sorted in descending order, and the top-S models with the highest weights are selected to form a representative model set. :
[0082] in, This indicates the maximum number of models that can be selected within each model cluster. When the number of models in a model cluster is less than... When that happens, select all models within that cluster.
[0083] The central server is based on a representative set of models. The sample size of each client is used to calculate the intra-cluster aggregation weight, and the result is obtained. Cluster representation model of a cluster :
[0084] Subsequently, the central server calculates the inter-cluster aggregation weights based on the total sample size of each model cluster, and performs a secondary aggregation on all cluster representative models to obtain the updated global intrusion detection model parameters. :
[0085] Through the above adaptive hierarchical Top-S aggregation process, the central server can first divide the model clusters according to the client model update direction and parameter structure, and then select representative models in each cluster to participate in the aggregation, thereby reducing the negative impact of low-quality models, biased models or abnormal models on the global aggregation results and improving the aggregation quality and robustness of the global model.
[0086] Step 6: Repeat the federated collaboration training.
[0087] After the central server completes one round of condition generator training and adaptive hierarchical Top-S aggregation, it sends the updated global intrusion detection model, condition generator, global class distribution prior, and total global sample size to each client.
[0088] Each client continues to perform scale-aware meta-distillation training and uploads the trained local model parameters to the central server; the central server continues to train the condition generator and performs adaptive hierarchical Top-S aggregation.
[0089] Repeat the above process until the preset number of global communication rounds is reached. Throughout the entire federated collaborative training process, the client's raw network traffic data remains locally, while the central server only receives category statistics and model parameters.
[0090] Step 7: The client performs local customization adjustments.
[0091] After completing all global communication rounds, the central server sends the final global intrusion detection model to each client. The client uses the parameters of the final global intrusion detection model as initialization parameters to perform one or more rounds of supervised training on its local network traffic dataset, obtaining a local personalized intrusion detection model.
[0092] The locally personalized intrusion detection model is used to classify network traffic samples collected locally on the client side, outputting either normal traffic categories or attack traffic categories. Through local personalized fine-tuning, the client model can further adapt to the local device environment, business traffic patterns, and attack category distribution, improving the model's detection stability when deployed on actual IoT edge devices.
[0093] In summary, this invention, through a complete process of "global category distribution prior construction—condition generator training—scale-aware meta-distillation training—adaptive hierarchical Top-S aggregation—local personalized fine-tuning," achieves synergistic optimization of global category consensus utilization, rapid local adaptation, and high-quality model aggregation without sharing the client's original network traffic data. This effectively reduces the false negative rate of tail attack categories and a few attack categories, and improves the recall rate, robustness, and overall detection performance of the federated intrusion detection system.
[0094] To verify the effectiveness of the proposed low-false-miss federated intrusion detection method based on category consensus, multiple publicly available intrusion detection datasets were selected for experimental verification, and the results were compared with existing federated intrusion detection methods and typical federated learning methods. The experimental results are used to illustrate the performance improvement of this invention in scenarios involving non-independent and identically distributed data, long-tailed category distributions, and differences in client model quality, and are not intended to limit the scope of protection of this invention.
[0095] This embodiment uses four publicly available intrusion detection datasets—CIC-IDS2017, CIC-IDS2018, UNSW-NB15, and ToN-IoT—for experiments. These datasets cover various network traffic categories, including normal traffic, denial-of-service attacks, distributed denial-of-service attacks, brute-force attacks, port scanning, web attacks, injection attacks, and backdoor attacks, comprehensively reflecting the multi-category intrusion detection needs in IoT and network security scenarios. The number of samples for each category varies significantly across different intrusion detection datasets. Normal traffic or high-frequency attack categories typically constitute a large proportion, while some attack categories have fewer samples, exhibiting a clear long-tail category distribution characteristic. In federated learning scenarios, when the data is further divided among multiple clients, the attack categories and sample numbers held by different clients will differ, easily causing local models to favor locally dominant categories and reducing their detection capabilities for tail-end attack categories and a few other attack categories. Therefore, these datasets can be used to verify the effectiveness of this invention in reducing false negative rates and improving detection performance in complex and heterogeneous environments.
[0096] In the experimental setup, multiple clients were used as participants in federated learning. Each client used only the network traffic data obtained locally for model training and did not upload raw sample data to the central server. The central server was responsible for receiving the client's category statistics and local model parameters, and performing global category distribution prior construction, condition generator training, and adaptive hierarchical Top-S aggregation. During the experiment, parameters such as the number of clients, global communication rounds, local training rounds, and learning rate remained consistent across different methods to ensure the fairness of the comparison results.
[0097] To evaluate the intrusion detection performance of different methods, precision, recall, and F1 score are used as evaluation metrics. Precision measures the overall proportion of correct classifications by the model; recall measures the model's ability to detect attack traffic or target categories; a higher recall indicates a lower false negative rate; and the F1 score, considering both precision and recall, reflects the model's ability to balance false positives and false negatives. Since false negatives of attack traffic pose a high security risk in intrusion detection tasks, this embodiment focuses on improvements in recall and F1 score.
[0098] To further verify the advantages of the method of this invention, it is compared with methods such as DeepFed, FedProx, FedGen, and PFTD. DeepFed is a federated deep learning method for intrusion detection tasks, FedProx is a federated optimization method to mitigate the impact of heterogeneous data, FedGen is a generator-based dataless federated distillation method, and PFTD is a federated detection method for intrusion detection tasks. The performance comparison of different methods on four datasets is shown in Table 1.
[0099] Table 1. Performance comparison of different methods on four datasets.
[0100] As shown in Table 1, on the CIC-IDS2017, CIC-IDS2018, UNSW-NB15, and ToN-IoT datasets, the method of this invention achieved higher recall and F1 scores in most experimental settings, indicating that this invention can effectively improve the model's ability to identify attack traffic, especially minority attack categories and tail attack categories. Compared with traditional federated aggregation methods, this invention provides class consensus information to the client without sharing the client's original traffic data by constructing a global class distribution prior and training condition generator, which can alleviate the problem of insufficient detection capability caused by local class missing and class skew.
[0101] Meanwhile, experimental results show that the scale-aware meta-distillation mechanism in this invention can adaptively adjust the strength of class consensus distillation constraints according to the local sample size of the client, enabling small-scale clients to obtain more sufficient global class knowledge supplementation and avoiding excessive interference from external distillation signals for large-scale clients, thereby improving the stability of collaborative training between clients of different sizes. This mechanism helps reduce model class bias under non-independent and identically distributed data and long-tailed class distributions, and improves the detection capability of tail attack classes.
[0102] Furthermore, this invention employs an adaptive hierarchical Top-S aggregation strategy, which normalizes the representation of local models uploaded by clients, performs parameterless clustering, and filters representative models within clusters. This reduces the negative impact of low-quality models, biased models, or outlier models on the global aggregation process. Compared to directly weighting all client models, this aggregation strategy better adapts to the differences in client model distribution, improving the aggregation quality and robustness of the global model.
[0103] In summary, experimental results demonstrate that the low-false-miss federated intrusion detection method based on category consensus proposed in this invention can effectively utilize global category consensus information to mitigate category bias caused by long-tail category distribution and non-independent identically distributed data, reduce the false-miss rate of tail attack categories and minority attack categories, and improve the overall detection performance of the federated intrusion detection system, while protecting the privacy of the client's original network traffic data.
[0104] To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure 4 As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the method described above.
[0105] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.
[0106] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0107] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A low-false-miss federated intrusion detection method based on category consensus, characterized in that, include: S1, each client counts the number of samples of each category in the local network traffic dataset and uploads them to the central server. The central server constructs a global category distribution prior based on the category statistics uploaded by each client. S2, the central server initializes the global intrusion detection model and condition generator, and sends the current global intrusion detection model, condition generator, global category distribution prior, and total global sample size to each client; S3. After receiving the above information, each client performs scale-aware meta-distillation training: the inner layer is updated quickly to simulate the rapid adaptation of the local data distribution, and the outer layer is updated while introducing local supervision loss and distillation loss based on the category consensus pseudo-features generated by the condition generator. The trained local model is then uploaded to the central server. The weight of the distillation loss is adaptively calculated according to the local sample size of the client. S4, the central server uses the global category distribution prior and the classifiers in the local models uploaded by each client to train the condition generator, enabling it to generate category-controllable pseudo-features with global category consensus based on the given category label; S5, the central server performs adaptive hierarchical aggregation on the local models uploaded by each client: the local model parameters are normalized and represented, and then divided into multiple model clusters through parameterless clustering. Representative models are selected within each model cluster for intra-cluster aggregation, and then inter-cluster aggregation is performed on the representative models of each cluster to obtain the updated global intrusion detection model. S6, the central server sends the updated global intrusion detection model and condition generator to each client, repeating steps S3 to S5 until the preset global communication round is reached; S7. After completing all global communication rounds, the central server sends the final global intrusion detection model to each client. Each client then performs local customization fine-tuning of the final global intrusion detection model based on local network traffic data to obtain a customized intrusion detection model for local deployment.
2. The method according to claim 1, characterized in that, The construction of the global category distribution prior includes: Each client counts the number of samples in each category locally, and the central server calculates the global category distribution prior based on the category statistics uploaded by all clients.
3. The method according to claim 1, characterized in that, The training of the condition generator includes: The central server samples category labels based on the global category distribution prior, and generates pseudo-features by combining random noise input condition generator. The pseudo-features are then input into the classifiers in the local models uploaded by each client. The outputs of each classifier are weighted and aggregated according to the client sample size. The cross-entropy between the weighted aggregation result and the sampled category labels is used as the generator training loss for optimization.
4. The method according to claim 1, characterized in that, The scale-aware meta-distillation training includes: The client uses the global intrusion detection model as its local initial model, samples training batches from the local dataset, and divides them into support sets and query sets; A temporary model is obtained by performing an inner-layer fast adaptive update based on the support set; class labels are sampled based on the global class distribution prior, and class consensus pseudo-features are generated by combining random noise input condition generator; the pseudo-features are input into the classifier of the temporary model to calculate the distillation loss. Calculate the outer supervision loss of the temporary model on the query set; adaptively calculate the distillation weights based on the local sample size and the total global sample size; and weight the outer supervision loss and the distillation loss to obtain the outer update total optimization objective. Based on the overall optimization objective of the outer layer update, a meta-update is performed on the initial model to obtain the trained local model.
5. The method according to claim 1, characterized in that, The adaptive hierarchical aggregation includes: The local model parameters uploaded by each client are flattened into model vectors and normalized; a parameter-free clustering method is used to adaptively cluster the normalized model vectors to obtain multiple model clusters. Within each model cluster, representative models are selected according to client aggregation weights. These representative models are then aggregated within the cluster to obtain cluster representative models. Finally, cluster representative models are aggregated between clusters to obtain the updated global intrusion detection model.
6. The method according to claim 1, characterized in that, The local personalized tweaks include: The client uses the final global intrusion detection model parameters as initialization parameters to perform supervised training on the local network traffic dataset, resulting in a local personalized intrusion detection model. This model is used to classify network traffic samples collected locally by the client and output either normal traffic categories or attack traffic categories.
7. A low-false-miss federated intrusion detection system based on category consensus, characterized in that, include: The central server includes: The global prior construction module is used to construct a global category distribution prior based on the local category statistics information uploaded by each client; The condition generator training module is used to train the condition generator using the global class distribution prior and the classifiers in the local models uploaded by each client. The adaptive aggregation module is used to perform normalization, parameterless clustering, intra-cluster representative model selection, intra-cluster aggregation, and inter-cluster aggregation on the local models uploaded by each client to obtain the updated global intrusion detection model. And multiple clients deployed on IoT edge devices, each client including: The local statistics module is used to count the number of samples of each category in the local network traffic dataset and upload them to the central server; The scale-aware meta-distillation training module is used to simulate the rapid adaptation of local data distribution by quickly updating the inner layer, and then to conduct local training by updating the outer layer while introducing local supervision loss and distillation loss based on class consensus pseudo-features generated by the condition generator. The weight of the distillation loss is adaptively calculated according to the local sample size of the client. The local customization module is used to fine-tune the final global intrusion detection model based on local network traffic data after receiving it, so as to obtain a customized intrusion detection model for local deployment.
8. A computer device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement a low-miss-report federated intrusion detection method based on class consensus as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a low-miss-report federal intrusion detection method based on class consensus as described in any one of claims 1-6.
