CoolFace
Modelpublic

mtjikuzu/adversarial-robustness-energy-efficient-ids

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
Model Card

Adversarial Robustness vs Energy Efficiency in Network Intrusion Detection

Does Model Compression Compromise Cybersecurity? A Study on the Sustainability-Security Tradeoff

![Conference](https://iciset.nust.na) ![Track]() ![Dataset](https://huggingface.co/datasets/bvk/CICIDS-2017)


๐Ÿ”‘ Key Finding

Model compression can INCREASE adversarial robustness while reducing energy consumption.

70% magnitude pruning improves FGSM(ฮต=0.1) accuracy from 70.3% โ†’ 88.7% while cutting energy by ~48%. This contradicts the naive assumption that compressed models are more vulnerable.

๐Ÿ“Š Results Summary

ConfigurationClean AccFGSM(0.1)PGD(0.1)EnergySize (MB)
Full Model99.98%70.3%67.0%1.00x0.249
Pruned 50%99.98%73.4%69.4%0.65x0.249
Pruned 70%99.88%88.7%85.9%0.52x0.249
Pruned 90%75.7%75.8%75.8%0.38x0.249
Quantized 8-bit99.97%70.2%67.0%0.63x0.062
Prune70% + Q899.89%91.1%89.8%0.63x0.062

๐ŸŽฏ Overview

This research investigates a critical question at the intersection of cybersecurity and sustainability: When we compress deep learning IDS models for energy efficiency, do we inadvertently create security vulnerabilities?

We systematically evaluate:

  1. 1.Magnitude-based pruning (30%, 50%, 70%, 90%)
  2. 2.Post-training quantization (32-bit, 16-bit, 8-bit)
  3. 3.Combined compression (pruning + quantization)

Against adversarial attacks:

  • โ€”FGSM (Fast Gradient Sign Method) at ฮต = {0.01, 0.05, 0.1, 0.2, 0.3}
  • โ€”PGD (Projected Gradient Descent) at ฮต = {0.01, 0.05, 0.1, 0.2}

๐Ÿ“ Repository Structure

โ”œโ”€โ”€ README.md                    # This file
โ”œโ”€โ”€ METHODOLOGY.md               # Full experimental design
โ”œโ”€โ”€ experiment.py                # Complete working prototype
โ”œโ”€โ”€ paper_draft.tex              # Springer ACSAR formatted paper
โ”œโ”€โ”€ requirements.txt             # Dependencies
โ”œโ”€โ”€ figures/
โ”‚   โ”œโ”€โ”€ fig1_pruning_robustness.png
โ”‚   โ”œโ”€โ”€ fig2_quantization_robustness.png
โ”‚   โ”œโ”€โ”€ fig3_pareto_energy_robustness.png
โ”‚   โ””โ”€โ”€ fig4_fgsm_sweep.png
โ””โ”€โ”€ results/
    โ””โ”€โ”€ full_results.csv

๐Ÿš€ Quick Start

bash
pip install torch scikit-learn datasets numpy pandas matplotlib
python experiment.py

The experiment loads CICIDS-2017 from HuggingFace, trains a DNN IDS, then systematically evaluates compressed variants under adversarial attacks.

๐Ÿ“ Why Pruning Improves Robustness

Our results align with recent findings (PwoA, 2210.04311; MAD, 2204.02738):

  • โ€”Pruning removes low-magnitude "noise" weights that adversarial perturbations exploit
  • โ€”Compressed representations are inherently more robust to input perturbations
  • โ€”The regularization effect of sparsity acts as an implicit defense

This creates a win-win for sustainability: compressed models are both greener AND more secure.

๐Ÿ“š Key References

  1. 1.Goodfellow et al. "Explaining and Harnessing Adversarial Examples" (ICLR 2015)
  2. 2.Madry et al. "Towards Deep Learning Models Resistant to Adversarial Attacks" (ICLR 2018)
  3. 3.Bai et al. "Pruning Adversarially Robust Neural Networks without Adversarial Examples" (2022)
  4. 4.Lee et al. "Masking Adversarial Damage: Finding Adversarial Saliency for Robust and Sparse Network" (CVPR 2022)
  5. 5.Habib & Sharma. "Deep Learning in Advancing Proactive Cybersecurity for Smart Grid Networks" (2024)

๐Ÿ“ Conference

  • โ€”Conference: ICISET 2026 โ€” Namibia University of Science and Technology
  • โ€”Track: Infrastructure, Security and Governance โ€” Cybersecurity and Sustainability
  • โ€”Deadline: July 27, 2026

<!-- ml-intern-provenance -->

Generated by ML Intern

This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.

  • โ€”Try ML Intern: https://smolagents-ml-intern.hf.space
  • โ€”Source code: https://github.com/huggingface/ml-intern

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "mtjikuzu/adversarial-robustness-energy-efficient-ids"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.