Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ NeuroShield

AI-Powered Autonomous Cybersecurity Platform

Real-time threat detection β€’ Autonomous response β€’ 99.99% ML accuracy

Live Demo β€’ Documentation β€’ Report Bug β€’ Request Feature


πŸ“Œ Overview

NeuroShield is a production-grade, AI-powered Security Operations Center (SOC) platform that autonomously detects, analyzes, and responds to cybersecurity threats in real-time β€” without human intervention.

Built on cutting-edge ML models trained on real-world attack data (CICIDS2017), NeuroShield combines a Random Forest classifier (99.99% accuracy), Isolation Forest anomaly detection, and an intelligent auto-response engine to deliver enterprise-grade security at scale.

"The same technology that Fortune 500 companies spend millions on β€” built from scratch."


✨ Key Features

🧠 AI/ML Engine

  • Random Forest Classifier β€” 99.99% accuracy on real network attack data
  • Isolation Forest β€” Detects unknown zero-day anomalies without prior signatures
  • SMOTE Balancing β€” Handles real-world imbalanced threat data
  • Trained on CICIDS2017 β€” Industry-standard cybersecurity dataset (2.8M+ records)

πŸ” Threat Detection

  • Real-time log analysis with pattern-based detection
  • Detects: Port Scanning, Brute Force, SQL Injection, XSS, DDoS, and more
  • AI confidence scoring on every alert
  • Attack chain reasoning and kill-chain visualization

πŸ›‘οΈ Autonomous Response

  • Severity-based auto-response (Low β†’ Critical)
  • Automatic IP blocking on high/critical threats
  • Real-time Slack/Email alerting
  • Human-in-the-loop approval for critical actions

πŸ–₯️ Advanced Dashboard

  • 3D Interactive Globe β€” Live world attack map with animated arcs
  • Real-time charts: Area, Bar, Donut, Circular Gauges
  • Live threat feed with auto-refresh every 5 seconds
  • Dark cyberpunk UI with neon animations and Matrix effects

πŸ“‹ Compliance & Reporting

  • Auto-generated professional incident reports
  • SOC2 & ISO 27001 compliance templates
  • Full audit trail with timestamps
  • Risk scoring and impact assessment

πŸ› οΈ Tech Stack

Layer Technology
Backend FastAPI, SQLAlchemy, SQLite/PostgreSQL
AI/ML Scikit-learn, PyTorch, Isolation Forest, Random Forest
Data CICIDS2017, SMOTE (imbalanced-learn), Pandas, NumPy
Frontend React 18, Framer Motion, Recharts, Three.js
3D Globe react-globe.gl, Three.js
Security JWT Auth, RBAC, Rate Limiting
DevOps Docker, Railway, Vercel, GitHub Actions

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    NEUROSHIELD PLATFORM                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   FRONTEND   β”‚     BACKEND      β”‚      AI/ML ENGINE      β”‚
β”‚              β”‚                  β”‚                        β”‚
β”‚  React 18    β”‚   FastAPI        β”‚  Random Forest         β”‚
β”‚  3D Globe    β”‚   SQLAlchemy     β”‚  (99.99% accuracy)     β”‚
β”‚  Recharts    β”‚   Log Parser     β”‚                        β”‚
β”‚  Framer      β”‚   Auto-Response  β”‚  Isolation Forest      β”‚
β”‚  Motion      β”‚   Alert Engine   β”‚  (Anomaly Detection)   β”‚
β”‚              β”‚                  β”‚                        β”‚
β”‚  Dashboard   β”‚   REST API       β”‚  CICIDS2017 Dataset    β”‚
β”‚  Threat UI   β”‚   WebSocket      β”‚  50,000+ samples       β”‚
β”‚  AI Terminal β”‚   JWT Auth       β”‚  SMOTE Balancing       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

Python 3.10+
Node.js 18+
Git

1. Clone Repository

git clone https://github.com/yourusername/NeuroShield.git
cd NeuroShield

2. Backend Setup

cd backend
python -m venv venv
venv\Scripts\activate        # Windows


pip install -r requirements.txt

Create .env file:

APP_NAME=NeuroShield
DEBUG=True
DATABASE_URL=sqlite:///./neuroshield.db
SECRET_KEY=your-super-secret-key-here

Run backend:

uvicorn app.main:app --reload --port 8000

3. ML Models Setup

cd ml_engine
pip install -r requirements.txt

# Download CICIDS2017 dataset from Kaggle
# Place in ml_engine/data/cicids2017_cleaned.csv

python preprocess.py    # Data preprocessing + SMOTE
python train_models.py  # Train ML models

4. Frontend Setup

cd frontend
npm install
npm start

5. Open Browser

http://localhost:3000

πŸ“Š ML Model Performance

Model Accuracy Precision Recall F1-Score
Random Forest 99.99% 1.00 1.00 1.00
Isolation Forest 40.33%* β€” β€” β€”

*Isolation Forest is unsupervised β€” used for unknown anomaly detection, not classification accuracy.

Training Data: CICIDS2017 (50,000 samples after SMOTE balancing)

  • Normal Traffic: 49,787 samples
  • Port Scanning: 49,787 samples (after SMOTE)

πŸ“ Project Structure

NeuroShield/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # FastAPI entry point
β”‚   β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”‚   β”œβ”€β”€ config.py        # Settings & env vars
β”‚   β”‚   β”‚   └── database.py      # DB connection
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   └── threat.py        # SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   └── routes.py        # API endpoints
β”‚   β”‚   └── services/
β”‚   β”‚       β”œβ”€β”€ log_parser.py    # Log analysis
β”‚   β”‚       β”œβ”€β”€ predictor.py     # ML predictions
β”‚   β”‚       └── security.py      # Auto-response engine
β”‚   └── models/                  # Trained ML models
β”‚       β”œβ”€β”€ random_forest.pkl
β”‚       β”œβ”€β”€ isolation_forest.pkl
β”‚       β”œβ”€β”€ scaler.pkl
β”‚       └── label_encoder.pkl
β”‚
β”œβ”€β”€ ml_engine/
β”‚   β”œβ”€β”€ explore.py               # Data exploration
β”‚   β”œβ”€β”€ preprocess.py            # Data preprocessing
β”‚   β”œβ”€β”€ train_models.py          # Model training
β”‚   └── data/                    # Dataset (not in git)
β”‚
└── frontend/
    └── src/
        β”œβ”€β”€ App.js               # Router & auth
        β”œβ”€β”€ pages/
        β”‚   β”œβ”€β”€ Login.js         # Matrix rain login
        β”‚   β”œβ”€β”€ Dashboard.js     # 3D Globe + Charts
        β”‚   β”œβ”€β”€ ThreatCenter.js  # Live threat table
        β”‚   β”œβ”€β”€ AIAnalysis.js    # Neural net terminal
        β”‚   └── Reports.js       # Incident reports
        └── components/
            β”œβ”€β”€ Layout.js        # Sidebar navigation
            β”œβ”€β”€ StatsCards.js    # Animated stat cards
            └── CircularGauge.js # SVG gauge charts

πŸ”Œ API Endpoints

Method Endpoint Description
POST /api/v1/analyze-log Analyze raw log for threats
POST /api/v1/ml-predict ML model prediction
GET /api/v1/threats Get all detected threats
GET /api/v1/dashboard/stats Dashboard statistics
PUT /api/v1/threats/{id}/block Block a threat
POST /api/v1/security/auto-respond Trigger auto-response
POST /api/v1/security/block-ip Block an IP
GET /api/v1/security/blocked-ips List blocked IPs
POST /api/v1/security/incident-report Generate report

Interactive API Docs: http://localhost:8000/docs


πŸ§ͺ Testing

# Test threat detection
curl -X POST http://localhost:8000/api/v1/analyze-log \
  -H "Content-Type: application/json" \
  -d '{"raw_log": "Failed password for root from 192.168.1.105 port 22"}'

# Expected response:
# {
#   "threat_detected": true,
#   "attack_type": "BRUTE_FORCE",
#   "severity": "critical"
# }

🚒 Deployment

Backend β€” Railway

# Push to GitHub, connect Railway
# Set environment variables in Railway dashboard
railway up

Frontend β€” Vercel

# Push to GitHub, connect Vercel
# Set root directory to /frontend
vercel --prod

πŸ—ΊοΈ Roadmap

  • Core threat detection engine
  • ML model training (Random Forest + Isolation Forest)
  • Auto-response system
  • 3D dashboard with Globe visualization
  • LLM integration (GPT-4/Claude) for attack explanation
  • WebSocket real-time push notifications
  • Multi-user RBAC authentication
  • Kubernetes deployment config
  • IP Geolocation tracking
  • Dark Web threat intelligence feed

🀝 Contributing

# Fork the repo
git fork https://github.com/yourusername/NeuroShield

# Create feature branch
git checkout -b feature/amazing-feature

# Commit changes
git commit -m "Add amazing feature"

# Push and create PR
git push origin feature/amazing-feature

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


πŸ‘€ Author

Isha Singh Rathore


⭐ Star this repo if you found it helpful!

Built with ❀️ and a lot of β˜•

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages