FedDef: Robust Federated Learning-based Network Intrusion Detection Systems Against Gradient Leakage

Jiahui Chen, Yi Zhao, Qi Li, Ke Xu · DOI

Abstract

Deep learning (DL) methods have been widely applied to anomaly-based network intrusion detection system (NIDS) to detect malicious traffic. To expand the usage scenarios of DL-based methods, federated learning (FL) allows multiple users to train a global model on the basis of respecting individual data privacy. However, it has not yet been systematically evaluated how robust FL-based NIDSs are against existing privacy attacks under existing defenses. To address this issue, we propose two privacy evaluation metrics designed for FL-based NIDSs, including (1) privacy score that evaluates the similarity between the original and recovered traffic features using reconstruction attacks, and (2) evasion rate against NIDSs using adversarial attack with the recovered traffic. We conduct experiments to illustrate that existing defenses provide little protection and the corresponding adversarial traffic can even evade the SOTA NIDS Kitsune. To defend against such attacks and build a more robust FL-based NIDS, we further propose FedDef, a novel optimization-based input perturbation defense strategy with theoretical guarantee. It achieves both high utility by minimizing the gradient distance and strong privacy protection by maximizing the input distance. We experimentally evaluate four existing defenses on four datasets and show that our defense outperforms all the baselines in terms of privacy protection with up to 7 times higher privacy score, while maintaining model accuracy loss within 3% under optimal parameter combination.

Introduction: The Vulnerability of Collaborative NIDS

Network Intrusion Detection Systems (NIDS) are increasingly leveraging Deep Learning (DL) to identify malicious traffic patterns. Federated Learning (FL) offers a promising path for collaborative training across organizations while maintaining data privacy. However, FL is susceptible to "gradient leakage" attacks, where a malicious central server or participant can reconstruct raw training data from shared model updates.

In the context of NIDS, this leakage is particularly critical. Unlike image data, where leakage might only violate privacy, reconstructed network traffic features (e.g., IP addresses, ports, or packet timings) directly enable black-box adversarial attacks. If an adversary can reconstruct benign traffic, they can train a Generative Adversarial Network (GAN) to produce malicious traffic that appears "normal," effectively evading the NIDS.

The gradient leakage attack process: a malicious server uses shared gradients to reconstruct a user's private traffic data and labels.

The FedDef Defense Strategy

To counter these threats, we propose FedDef, an optimization-based input perturbation defense. Standard defenses like Differential Privacy (DP) or Gradient Pruning (GP) often fail to stop reconstruction attacks or degrade model accuracy to the point of making the NIDS ineffective. FedDef instead transforms private traffic data into "pseudo-data" ($x'$) and "pseudo-labels" ($y'$) before local training.

The core of FedDef is a dual-objective optimization problem solved at the local user level:

  1. Privacy (Maximize Distance): Make the pseudo-data $x'$ as numerically different from the original data $x$ as possible.
  2. Utility (Minimize Gradient Distance): Ensure that the gradient produced by the pseudo-pair $(x', y')$ is as close as possible to the gradient produced by the real data $(x, y)$.

By doing this, the user sends a gradient to the server that helps the model learn correct patterns but points back to fictitious "pseudo-data" if an attacker attempts to reverse-engineer it.

The FedDef workflow: local data is transformed into pseudo-data to protect privacy while maintaining utility, effectively neutralizing downstream adversarial attacks.

Novel Evaluation Metrics

Standard privacy metrics often fail to capture the security implications of leaked tabular traffic data. We introduce two specialized metrics for FL-based NIDS:

  • Privacy Score: A quantitative measure of the similarity between original and reconstructed features, handling both continuous and discrete data types.
  • Evasion Rate: A practical metric that measures the success of adversarial traffic—generated from reconstructed data—in bypassing the NIDS.

Experimental Results

We evaluated FedDef against four state-of-the-art defenses (DP, GP, Soteria, Instahide) across four benchmark datasets: KDD99, Mirai, CIC-IDS2017, and UNSW-NB15.

  • Superior Privacy Protection: FedDef achieved a Privacy Score 1.5 to 7 times higher than the strongest baseline (Differential Privacy).
  • Robustness to Adversarial Attacks: While attacks based on data leaked under other defenses often succeeded, adversarial traffic generated from FedDef-protected data resulted in a 0% evasion rate against the SOTA NIDS Kitsune.
  • High Model Utility: FedDef maintained detection accuracy within 3% of the no-defense baseline, significantly outperforming DP which often caused substantial accuracy degradation at high privacy levels.
  • Efficiency: While adding roughly 35% to local training time due to the optimization loop, FedDef is approximately 150x faster and more memory-efficient than cryptographic solutions like Homomorphic Encryption.

Conclusion and Future Work

FedDef provides a robust and feasible defense for FL-based NIDS. By intelligently steering data perturbations through optimization, it decouples model utility from data privacy, ensuring that collaborative learning does not become a gateway for adversarial exploitation. Future work will focus on "distilling" these transformations to reduce computational overhead and extending the evaluation from feature-space to raw packet-level traffic space.

Summary updated

BibTeX
@article{chen2023feddef,
  author = {Jiahui Chen and Yi Zhao and Qi Li and Ke Xu},
  title = {{FedDef: Robust Federated Learning-based Network Intrusion Detection Systems Against Gradient Leakage}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2023},
  url = {https://openreview.net/forum?id=Jz4mfIpFvs},
}
Figure