A state-of-the-art Network Intrusion Detection System that merges high-accuracy Machine Learning with Explainable AI (XAI). It provides security administrators with real-time visibility into network threats, complete with automated reasoning and mitigation suggestions.
- Vectorized Analysis: High-throughput packet processing engine using Scapy and NumPy.
- Protocol Agnostic: Analyzes TCP, UDP, and ICMP traffic with deep feature extraction.
- Hardware-Optimized: Automatic mapping to physical network adapters (WiFi/Ethernet) on Windows and Linux.
- The Classifier: A
RandomForestmodel trained on 2M+ flows for identifying known attack patterns (DDoS, Probe, PortScan, etc.). - The Guardian: An
IsolationForestunsupervised model for detecting zero-day anomalies that don't match known signatures. - Global Feature Schema: Standardized 6-feature pipeline (duration, counts, bytes, ports, protocols) for cross-dataset compatibility.
- SHAP Integration: Visualizes exactly why a flow was flagged, highlighting the most suspicious features.
- Activity Heatmaps: Continuous D3.js-powered traffic monitoring.
- Live Notifications: Instant alerts in the unified security feed for critical threats.
📂 Network Traffic Analyzer
├── 📂 backend # FastAPI + ML Engine
│ ├── 📂 app # API Routing & Schemas
│ ├── 📂 data # SQL Databases & ML Artifacts
│ ├── 📂 models # Trained .pkl Model Files
│ ├── 📂 services # Core logic (Capture, Model, Alerts)
│ ├── 📂 utils # Standardized Data Cleaning & AI Schemas
│ └── 📂 tests # Security & Unit Tests
├── 📂 frontend # React + Vite Dashboard
│ ├── 📂 src/components # Reusable UI Modules
│ ├── 📂 src/pages # Dashboard Views
│ └── 📂 src/services # API Connectivity Layer
├── 📂 docker # Deployment configurations
└── 📄 Makefile # Unified project management
Use the provided Makefile to set up both environments automatically:
make installCreate your .env file from the provided example:
cp .env.example .env
# Set VITE_API_URL=http://localhost:8000In two separate terminals, launch the backend and frontend:
Backend:
make dev-backendFrontend:
make dev-frontendFor production-ready deployment with a single command:
make upIf you have custom PCAP datasets, place them in backend/data/raw/ and run:
make trainImportant
Windows Users: Ensure you have Npcap or WinPcap installed for the real-time sniffer to access network hardware. Download it at npcap.com.
© 2026 NIDS Team | Optimized for SOC Level 2/3 Environments