A full-stack AI/ML surveillance intelligence system that simulates a multi-sensor border defence network using real cybersecurity datasets, trained machine learning models, and a Post-Quantum Cryptography signing layer.
- Simulates real-world border intelligence systems
- Combines AI + Cybersecurity + Post-Quantum Cryptography
- Demonstrates multi-layer threat detection pipeline
- Shows how ML outputs can be secured against tampering
- Overview
- Problem Statement Fulfillment
- System Architecture
- AI/ML Models
- Navigation Modules
- Quantum Security Layer
- Tech Stack
- Datasets
- Project Structure
- Setup & Installation
- API Reference
- ML Pipeline Results
- System Notes & Limitations
- 3 ML models integrated in a real-time pipeline
- 8 REST API endpoints powering full-stack system
- 8,200+ dataset rows processed and merged
- Post-quantum signature chain with key rotation
- Full-stack architecture (React + Flask + ML pipeline)
CHAKRAVYUH-AI v1.0 is a full-stack, dataset-driven border defence surveillance dashboard that integrates multiple AI/ML paradigms β supervised learning, unsupervised anomaly detection, and deep learning β into a unified real-time intelligence platform.
The system processes data from 5 real cybersecurity and IoT datasets, runs 3 AI/ML models simultaneously, and presents actionable threat intelligence through a military-grade React dashboard with 10 operational modules. All threat outputs, risk zones, sensor readings, and alert classifications are derived from real datasets. Most outputs are derived from real datasets, with fallback logic used when features are unavailable.
"Inspired by the ancient military formation β an inescapable, multi-layered defence system."
| # | Objective | Implementation | Status |
|---|---|---|---|
| 1 | EDA on surveillance & sensor datasets | ML pipeline generates full EDA dashboard from 5 merged real datasets | β |
| 2 | Build anomaly detection models | Isolation Forest β 975 anomalies detected, 12% contamination | β |
| 3 | Classify using ML/DL techniques | Random Forest (80.2% acc) + YOLOv8 deep learning | β |
| 4 | Predict high-risk zones | 27 risk zones predicted from historical incident data | β |
| 5 | Alert prioritization to reduce false positives | Weighted CRITICAL/HIGH/MEDIUM/LOW with action log | β |
| Challenge | Solution |
|---|---|
| Large-Scale Monitoring | 8,208 rows merged from 5 real datasets |
| Delayed Threat Detection | YOLOv8 CCTV detection + dataset-driven sensor feed |
| False Alarms | Isolation Forest anomaly filtering + FP suppression |
| Resource Constraints | Drone module simulating aerial coverage of remote zones |
| Data Integration | Auto-discovery ML pipeline with fuzzy schema mapping |
- YOLO detects objects from CCTV / dataset
- Features extracted into structured vectors
- Isolation Forest detects anomalies
- Random Forest classifies threat levels
- Alert priority is calculated
- Output is signed using post-quantum cryptography
- Data is sent to dashboard via REST APIs
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA SOURCES β
β NSL-KDD Β· RT-IoT2022 Β· UNSW-NB15 Β· Network CSV Β· Intrusion β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ML PIPELINE (run_pipeline.py) β
β Auto-Discovery β Fuzzy Merge (8,208 rows) β EDA β Train β
β β β β β
β Isolation Forest Random Forest EDA Charts β
β (iso_model.pkl) (rf_model.pkl) (5 PNGs) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β PKL files + CSV outputs
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLASK BACKEND (app.py) β
β β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββββββ β
β β YOLOv8 β β Iso Forest β β Random Forest β β
β β (webcam) β β (anomaly) β β (classification) β β
β ββββββββββββββββ βββββββββββββββββ βββββββββββββββββββββββββ β
β β β
β Quantum Security Layer (quantum_security.py) β
β Kyber-512 KEM Β· Dilithium2 Signatures Β· AES-256-GCM β
β β
β REST API Endpoints β frontend + quantum dashboard β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β JSON
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REACT FRONTEND (App.jsx) β
β β
β OVERVIEW Β· LIVE DEMO Β· CCTV Β· DRONE Β· THREATS Β· ANALYTICS β
β SENSORS Β· OSINT Β· MAP Β· QUANTUM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Stage | Name | Model / Method |
|---|---|---|
| 1 | Object Detection | YOLOv8n (COCO fallback) |
| 2 | Feature Extraction | 10-feature vector from detections |
| 3 | Anomaly Scoring | Isolation Forest (PKL) / formula fallback |
| 4 | Threat Classification | Random Forest (PKL) / rule-based fallback |
| 5 | Alert Priority | Weighted formula + FP suppression |
| 6 | Quantum Signing | Dilithium2 (liboqs) / HMAC-SHA3-256 fallback |
- Type: Deep Learning / Computer Vision
- Use: Real-time CCTV object detection β detects persons, vehicles, and objects with bounding boxes and confidence scores
- Custom CentroidTracker: Euclidean distance matching (80px threshold), 20-point path history, 8-frame disappearance logic for persistent object tracking
- Fallback: Claude Vision API when YOLOv8 unavailable
Note: Live CCTV detection requires a physical webcam. In evaluation without hardware, the system continues via dataset-driven threat simulation.
- Type: Unsupervised Machine Learning
- Use: Detects abnormal sensor patterns without labelled data β catches novel threats no known category covers
- Config:
contamination=0.12 Β· n_estimators=200 Β· random_state=42 - Results: 975 anomalies detected Β· 12% contamination rate
- Trained on: RT-IoT2022, NSL-KDD, UNSW-NB15
- Type: Supervised Machine Learning
- Use: Classifies sensor events into CRITICAL / HIGH / MEDIUM / LOW threat levels with probability scores
- Config:
n_estimators=200 Β· max_depth=12 Β· 5-fold cross-validation - Results: 80.2% accuracy Β· 5-fold CV 73.9%
- Why RF: Interpretable classifications β unlike deep learning, every decision can be explained by feature contribution
| Module | Description |
|---|---|
OVERVIEW |
Live KPIs (total/active/neutralized/falsePos), threat log, 24-hour timeline β all from real dataset rows |
LIVE DEMO |
5-stage ML pipeline visualiser: Webcam β YOLO β Anomaly β Priority β Map Marker |
π· CCTV |
YOLOv8 object detection with bounding boxes and CentroidTracker path trails (webcam required) |
πΈ DRONE |
Simulated aerial surveillance β GARUDA-1/2/3 UAVs, IR/VIS mode, 1Γ/2Γ/4Γ/8Γ zoom (simulated) |
THREATS |
Dataset-driven threat feed (4 per level), Cognitive Tactical SITREP, NEUTRALIZE/MONITOR/ESCALATE actions |
ANALYTICS |
5 EDA charts from ML pipeline, classification results, anomaly detection visuals |
SENSORS |
6 sensor cards (VISUAL Β· IR Β· SEISMIC Β· RF Β· SATELLITE Β· ACOUSTIC) β dataset-driven readings |
OSINT |
27 ML-predicted high-risk border zones from high_risk_zone_predictions.csv |
π MAP |
World map with India LoC/LAC overlays, threat markers, Markov-chain infiltration route predictor |
β QUANTUM |
Live PQC dashboard β algorithm status, signature chain feed, key rotation timer, chain verification |
CHAKRAVYUH-AI v1.0 introduces a Post-Quantum Cryptography layer that cryptographically signs every ML pipeline output and chains the signatures together to create a tamper-evident audit trail.
Classical encryption (RSA, ECC) used in current defence systems is vulnerable to quantum computers running Shor's algorithm. NIST finalised post-quantum standards in 2024. CHAKRAVYUH-AI implements these standards to demonstrate quantum-resistant ML output integrity β a real and near-term concern for defence AI systems.
| Algorithm | Standard | Role |
|---|---|---|
| CRYSTALS-Kyber-512 | NIST FIPS 203 | Key Encapsulation β protects AES session key |
| CRYSTALS-Dilithium2 | NIST FIPS 204 | Digital Signatures β signs every ML output |
| AES-256-GCM | NIST FIPS 197 | Bulk Encryption β encrypts threat payloads |
| SHA3-256 | NIST FIPS 202 | Pre-hash for signature construction |
Every ML output (threat level, anomaly score, alert priority) is:
- Hashed with SHA3-256
- Signed with Dilithium2
- Linked to the previous output's hash
This creates a cryptographically linked chain. Modifying any output after signing β even by one byte β breaks the signature and invalidates all subsequent links. The QUANTUM module provides on-demand chain integrity verification.
Kyber and Dilithium keys rotate automatically every 15 minutes via a background thread. Compromising a current session key cannot decrypt past sessions.
The liboqs-python native PQC library requires platform-specific compilation. When not installed, the system automatically falls back to HMAC-SHA3-256 + AES-256-GCM. The QUANTUM dashboard displays the active mode clearly:
PQC ACTIVE β liboqs installed Β· Kyber-512 + Dilithium2 running
FALLBACK MODE β liboqs unavailable Β· HMAC-SHA3-256 + AES-256-GCM active
This is graceful degradation by design β not an error state. All chain, rotation, tamper detection, and verification features operate identically in both modes.
# Install full PQC mode
pip install liboqs-python pycryptodomeFrontend
- React 18 β Single Page Application, 10 modules, 3,500+ lines
- HTML5 Canvas β world map with 4-pass glow rendering + DPR scaling, drone canvas with zoom
- Recharts β analytics charts, radar chart, area charts
- Orbitron + Share Tech Mono β military-grade dark UI
Backend
- Python Flask β REST API, 8 endpoints
- Ultralytics YOLOv8 β real-time object detection
- scikit-learn β Random Forest + Isolation Forest inference
quantum_security.pyβ PQC signing layer (Kyber + Dilithium + AES)
ML Pipeline
- Auto-discovery scanner β recursively finds and merges all CSV datasets
- Fuzzy column mapping β handles schema differences across datasets automatically
- Generates PKL model files + 5 EDA visualisation PNGs + risk zone CSV
| Dataset | Size | Domain | Use |
|---|---|---|---|
| NSL-KDD (Train + Test) | ~5.1 MB | Network Intrusion | RF threat classification |
| RT-IoT2022 | 52 MB | IoT Sensor Data | Anomaly detection |
| UNSW-NB15 Events | 5 KB | Network Events | Feature augmentation |
| train_test_network.csv | 29 MB | Network Traffic | Multi-class classification |
| cybersecurity_intrusion_data.csv | 709 KB | Intrusion Patterns | EDA + feature analysis |
β οΈ Datasets not included in repository due to size. Place all CSV files indatasets/folder before running the pipeline.Sources: NSL-KDD Β· UNSW-NB15 Β· RT-IoT2022
chakravyuh_ai/
β
βββ π backend/
β βββ app.py # Flask REST API β 6-stage ML pipeline
β βββ quantum_security.py # PQC layer (Kyber + Dilithium + AES)
β βββ requirements.txt
β βββ chakravyuh_outputs/ # PKL models + CSV outputs (git-excluded)
β
βββ π frontend/
β βββ π src/
β β βββ App.jsx # React SPA β 10 modules (3,500+ lines)
β βββ π public/
β β βββ π maps/
β β βββ ne_50m_admin_0_countries.json # Natural Earth GeoJSON
β βββ package.json
β βββ package-lock.json
β
βββ π ml_pipeline/
β βββ run_pipeline.py # Auto-discovery ML training pipeline
β βββ requirements.txt
β βββ chakravyuh_outputs/ # Generated charts, CSVs, PKLs
β
βββ π datasets/ # Real CSV files (git-excluded)
β βββ Train_data.csv
β βββ Test_data.csv
β βββ RT_IOT2022.csv
β βββ train_test_network.csv
β βββ cybersecurity_intrusion_data.csv
β βββ UNSW-NB15_LIST_EVENTS(in).csv
β
βββ download_borders.py # Downloads Natural Earth GeoJSON
βββ .gitignore
βββ LICENSE
βββ README.md
cd backend
pip install flask flask-cors numpy pandas scikit-learn joblib ultralytics
pip install liboqs-python pycryptodome # Optional β full PQC mode
pip install anthropic # Optional β Claude SITREP
python app.py
# API running at http://localhost:5000cd frontend
npm install
npm start
# Dashboard running at http://localhost:3000cd ml_pipeline
pip install numpy pandas scikit-learn matplotlib seaborn joblib
python run_pipeline.py
# Copy outputs to backend (Windows)
copy chakravyuh_outputs\*.pkl ..\backend\chakravyuh_outputs\
copy chakravyuh_outputs\*.csv ..\backend\chakravyuh_outputs\python download_borders.py
# Places ne_50m_admin_0_countries.json β frontend/public/maps/# PowerShell only β never store API keys in files
$env:ANTHROPIC_API_KEY = "sk-ant-..."The system runs fully offline with local fallbacks for all AI features. No external API keys are required for core functionality.
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
System status β models, engines, quantum, uptime |
POST |
/api/analyze-frame |
Full 6-stage ML + Quantum pipeline per frame |
POST |
/api/tactical-brief |
AI-generated SITREP (Claude / local fallback) |
GET |
/api/risk-zones |
27 ML-predicted high-risk border zones |
GET |
/api/sensor-data |
Balanced threat feed (4 per level, real CSV rows) |
GET |
/api/quantum-status |
Live PQC metrics: algorithms, chain, key rotation |
POST |
/api/quantum-verify |
On-demand full signature chain integrity verification |
GET |
/api/quantum-signatures |
Last N signed ML payloads for live feed display |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CHAKRAVYUH-AI ML Pipeline v5.0 β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Datasets discovered : 5 files β
β Total rows merged : 8,208 β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Random Forest Accuracy : 80.2% β
β Cross-Validation (5-fold) : 73.9% β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Isolation Forest : 12% contamination β
β Anomalies Detected : 975 β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Risk Zones Predicted : 27 β
β PKL Models Generated : 2 β
β EDA Charts Generated : 5 β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Quantum Signatures Issued : Live (grows per run) β
β Chain Integrity : INTACT β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Area | Status | Notes |
|---|---|---|
| CCTV live feed | Hardware required | YOLOv8 detection works with webcam; module inactive without one |
| Drone surveillance | Simulated | Canvas-based simulation β no real UAV hardware connected |
| Quantum PQC (full) | Optional | Requires liboqs-python; graceful HMAC fallback always active |
| Claude API | Optional | Local rule-based tactical brief fallback active without key |
| Satellite feeds | Not implemented | All sensor readings are dataset-derived, not live satellite data |
| Military deployment | Academic only | Research and internship demonstration project β not a production system |
This system is a dataset-driven simulation built for academic evaluation and research. It demonstrates the feasibility of integrating multiple AI/ML paradigms into a unified defence intelligence interface β not a deployable military product.
- API keys are never stored in source files β set via environment variables only
- All datasets excluded from repository via
.gitignore - PKL model files excluded β regenerate using
run_pipeline.py - YOLOv8 weights excluded β auto-downloaded by Ultralytics on first run
CHAKRAVYUH-AI v1.0 Β· Border Defence & Surveillance Intelligence Dashboard