← All Projects
Project Deployed

Edge-NIDS: On-Device Intrusion Detection for IoT

A quantized CNN intrusion-detection model deployed to an ARM Cortex-M microcontroller for real-time IoT traffic monitoring without cloud connectivity.

Overview

Edge-NIDS compresses a network-intrusion-detection classifier down to under 64KB so it can run directly on a Cortex-M4 microcontroller, flagging malicious traffic patterns locally without sending data to the cloud. The project combines the NIDS classifier from my adversarial-robustness reproduction with post-training quantization and structured pruning.

Architecture

A lightweight 1D-CNN ingests windowed flow-feature vectors; INT8 post-training quantization and 60% structured channel pruning reduce the footprint roughly 9x versus the FP32 baseline, with inference over TensorFlow Lite Micro's interpreter on the device.

Client / Edge
Model Pipeline
Output / API

Tech Stack

TensorFlow Lite Micro C++ STM32 Python CIC-IDS2017

Screenshots

Screenshot 1
Screenshot 2
Screenshot 3

Lessons Learned

Quantization-aware fine-tuning after pruning recovered nearly all the accuracy lost to compression, whereas post-training quantization alone on the pruned model degraded accuracy noticeably. Getting realistic power/latency numbers required actually flashing hardware — simulator numbers were consistently optimistic by 15-20%.

ls -la ./related-projects/