Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Neuromorphic Cybersecurity with Semi-supervised Lifelong Learning

A PyTorch-based implementation of neuromorphic cybersecurity systems using spiking neural networks (SNNs) for Network Intrusion Detection Systems (NIDS). This project implements a hierarchical SNN architecture with Growing When Required (GWR) mechanisms for lifelong learning of cyber threats, enabling networks to dynamically adapt to new attack patterns while preserving knowledge of existing threats.

Python 3.8+ PyTorch License: MIT arXiv ICONS 2025

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/zesun33/neuromorphic-cybersecurity-for-lifelong-learning.git
cd neuromorphic-cybersecurity

# Install dependencies
pip install torch torchvision numpy matplotlib seaborn plotly pandas scikit-learn tqdm wandb

# The modified BindsNET framework is included in the bindsnet/ directory

Run Your First Experiment

# Network intrusion detection with UNSW-NB15 (Primary focus)
cd notebooks
python current/network_test_nids_v23.py --trial_name nids_experiment --n_epochs 10 --gpu

# MNIST digit classification with GWR (for comparison)
python current/mnist_gwr_v7.py --trial_name mnist_experiment --n_epochs 5 --gpu

Expected Results: NIDS should achieve ~85.3% overall accuracy across 9 attack types with robust adaptation to new threats. MNIST should achieve ~95% accuracy with network growth from 10 to ~20 neurons.

🧠 Key Features

Hierarchical Neuromorphic Architecture

  • Static SNN Layer: Efficient initial threat detection and filtering
  • Dynamic SNN Layer: Adaptive classification of specific attack types
  • Bio-plausible Learning: Mimics biological adaptation mechanisms
  • Energy Efficiency: High operational sparsity for low-power deployment

Lifelong Learning for Cybersecurity

  • Threat Adaptation: Learn new attack patterns without forgetting existing ones
  • GWR Structural Plasticity: Dynamic network growth based on threat complexity
  • Adaptive STDP: Novel learning rule for continuous threat learning
  • Catastrophic Forgetting Mitigation: Preserve knowledge of known threats

Multi-Dataset Support

  • UNSW-NB15: Primary cybersecurity benchmark (23 features, 9 attack types)
  • MNIST: Handwritten digit classification for comparison (28Γ—28 images, 10 classes)
  • Iris: Classic flower classification (4 features, 3 classes)
  • Custom Threat Datasets: Easy integration for new attack patterns

Advanced Monitoring

  • WandB Integration: Comprehensive experiment tracking and visualization
  • Real-time Plots: Network dynamics, weight evolution, and performance metrics
  • Statistical Analysis: Precision, recall, F1-score, and growth statistics

πŸ“Š Research Applications

This framework is designed for researchers working on:

  • Neuromorphic Cybersecurity: Applying brain-inspired computing to cyber threat detection
  • Lifelong Learning: Continuous adaptation to evolving cyber threats
  • Spiking Neural Networks: Energy-efficient neural computation for edge security
  • Network Intrusion Detection: Real-time threat classification and adaptation
  • Bio-plausible Learning: Mimicking biological adaptation mechanisms in artificial systems

πŸ”¬ Technical Highlights

Modified BindsNET Framework

  • New Model Classes: DiehlAndCook2015GWR, DiehlAndCook2015ReInit, DiehlAndCook2015AdaptiveLR
  • Adaptive STDP: Modified spike-timing-dependent plasticity with firing factor integration
  • Dynamic Topology: Support for runtime network structure changes

GWR Algorithm Implementation

  • BMU Selection: Best Matching Unit identification for weight initialization
  • Firing Factor Management: Exponential decay-based neuron activity tracking
  • Threshold Adaptation: Dynamic spike thresholds based on network size and performance

πŸ“š Documentation

Getting Started

Technical References

Usage Guides

Analysis & Troubleshooting

πŸ—‚οΈ Repository Structure

β”œβ”€β”€ notebooks/                    # Experiment scripts and data
β”‚   β”œβ”€β”€ current/                 # Latest experiment implementations
β”‚   β”‚   β”œβ”€β”€ mnist_gwr_v7.py     # MNIST with GWR
β”‚   β”‚   β”œβ”€β”€ network_test_nids_v23.py  # NIDS experiments
β”‚   β”‚   └── CustomDataloader.py  # Continual learning data loaders
β”‚   β”œβ”€β”€ data/                    # Datasets and preprocessed files
β”‚   β”œβ”€β”€ utils/                   # Utility scripts and helpers
β”‚   └── archive/                 # Historical versions
β”œβ”€β”€ bindsnet/                    # Modified BindsNET framework
β”‚   β”œβ”€β”€ models/                  # GWR model implementations
β”‚   β”œβ”€β”€ learning/                # Adaptive learning rules
β”‚   └── network/                 # Network topology management
β”œβ”€β”€ docs/                        # Comprehensive documentation
β”‚   β”œβ”€β”€ USAGE/                   # Dataset-specific guides
β”‚   β”œβ”€β”€ REFERENCE/               # Technical references
β”‚   β”œβ”€β”€ GUIDES/                  # Analysis and troubleshooting
β”‚   └── *.md                     # Core documentation files
└── Images/                      # Generated plots and figures

🎯 Performance Benchmarks

UNSW-NB15 Cybersecurity (Primary Focus)

  • Overall Accuracy: 85.3% across 9 attack types
  • Lifelong Learning: Robust adaptation to new threats while preserving existing knowledge
  • Operational Sparsity: High sparsity confirmed via Intel Lava framework
  • Energy Efficiency: Optimized for low-power neuromorphic hardware deployment
  • False Positive Rate: <10% for normal traffic classification

MNIST Classification (Comparison)

  • Base Accuracy: ~95% on standard MNIST
  • Continual Learning: Maintains >90% on old classes while learning new ones
  • Network Growth: Typically grows from 10 to 15-25 neurons
  • Training Time: ~5-10 minutes on GPU for 10 epochs

Iris Classification

  • Accuracy: >95% on 3-class flower classification
  • Network Efficiency: Minimal growth needed (10-12 neurons)
  • Training Speed: <1 minute for complete training

πŸ› οΈ Requirements

System Requirements

  • Python: 3.8+
  • PyTorch: 1.9+
  • CUDA: Optional but recommended for GPU acceleration
  • Memory: 8GB+ RAM recommended for larger experiments
  • Storage: 2GB+ for datasets and experiment logs

Python Dependencies

torch>=1.9.0
torchvision>=0.10.0
numpy>=1.21.0
matplotlib>=3.3.0
seaborn>=0.11.0
plotly>=5.0.0
pandas>=1.3.0
scikit-learn>=1.0.0
tqdm>=4.60.0
wandb>=0.12.0

πŸš€ Advanced Usage

Parameter Optimization

# Grid search over key parameters
python current/mnist_gwr_v7.py --spike_threshold 0.05 --firing_threshold_grow 0.1
python current/mnist_gwr_v7.py --spike_threshold 0.07 --firing_threshold_grow 0.2
python current/mnist_gwr_v7.py --spike_threshold 0.09 --firing_threshold_grow 0.3

Custom Dataset Integration

# Example: Wine quality dataset
from notebooks.current.CustomDataloader import IncrementalClassDataset
from your_dataset_loader import WineQualityDataset

# Create continual learning setup
dataset = WineQualityDataset('path/to/wine_data.csv')
continual_dataset = IncrementalClassDataset(dataset.data, dataset.targets)

Experiment Tracking

import wandb

# Initialize experiment tracking
wandb.init(
    project='Continual_Learning_SNN',
    name='custom_experiment',
    config={
        'dataset': 'custom',
        'spike_threshold': 0.07,
        'n_epochs': 10
    }
)

πŸ“– Citation

If you use this code in your research, please cite our paper:

@article{mia2025neuromorphic,
  title={Neuromorphic Cybersecurity with Semi-supervised Lifelong Learning},
  author={Mia, Md Zesun Ahmed and Bal, Malyaban and Lu, Sen and Nishibuchi, George M and Chelian, Suhas and Vasan, Srini and Sengupta, Abhronil},
  journal={arXiv preprint arXiv:2508.04610},
  year={2025},
  url={https://arxiv.org/abs/2508.04610}
}

Paper: Neuromorphic Cybersecurity with Semi-supervised Lifelong Learning
Conference: Accepted at ACM International Conference on Neuromorphic Systems (ICONS) 2025

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details on:

  • Code style and standards
  • Testing requirements
  • Documentation updates
  • Issue reporting

Development Setup

# Clone for development
git clone https://github.com/zesun33/neuromorphic-cybersecurity-for-lifelong-learning.git
cd neuromorphic-cybersecurity

# Install in development mode
pip install -e .

# Run tests
python -m pytest tests/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • BindsNET Team: For the foundational spiking neural network framework
  • PyTorch Community: For the excellent deep learning platform
  • Intel Lava Framework: For neuromorphic hardware simulation capabilities
  • Research Community: For neuromorphic computing and cybersecurity research contributions
  • Dataset Providers: UNSW-NB15, MNIST, and Iris dataset maintainers
  • ICONS 2025 Conference: For accepting our work and providing valuable feedback

πŸ“ž Contact & Support

πŸ”— Related Projects


Ready to explore neuromorphic cybersecurity with lifelong learning?

πŸš€ Start here: Quick Start Guide
πŸ“š Learn more: Full Documentation
πŸ”¬ Research: Results Interpretation Guide
πŸ“„ Paper: Neuromorphic Cybersecurity with Semi-supervised Lifelong Learning


Last updated: January 2025

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages