An open-source, research-focused platform for simulating and visualizing biologically realistic spiking neural networks (SNNs) based on anatomical brain region data from leading neuroscience atlases.
Mission: To create accessible, scientifically grounded tools for exploring brain emulation concepts through interactive visualization and atlas-based neural network templates.
This project enables researchers, neuroengineers, cognitive scientists, and students to:
- Build biologically realistic neural networks using templates derived from real brain atlases (Allen Brain Atlas, BrainGlobe, Julich-Brain)
- Visualize network dynamics with an interactive 3D interface showing neuron activity, connectivity, and voltage traces
- Explore different brain regions including prefrontal cortex, motor cortex, visual cortex, somatosensory cortex, and thalamocortical loops
- Experiment with neuron types such as pyramidal cells, basket interneurons, chandelier cells, Purkinje cells, and thalamic relay neurons
- Import and export custom network configurations with full provenance tracking
Pre-configured network templates based on real neuroscience data:
- Allen Motor Cortex (BA4): Layer-specific cortical column with corticospinal Layer 5B neurons
- Allen Prefrontal Cortex (BA10/46): Two-cluster abstraction with excitatory/inhibitory populations
- Allen Somatosensory Cortex (BA3b): Barrel-column representation with thalamorecipient layer 4
- BrainGlobe Visual Cortex: Feedforward V1→V2 stream from MNI152 atlas
- Julich Thalamocortical Loop: Mediodorsal thalamus ↔ prefrontal cortex circuit
Accurately modeled neuron types with distinct morphologies and firing patterns:
- Cortical: Pyramidal, spiny stellate, Betz cells (giant pyramidal)
- Interneurons: Basket, chandelier, Martinotti, double bouquet, neurogliaform
- Cerebellar: Purkinje, granule, Golgi, stellate
- Hippocampal: Mossy cells, dentate granule
- Subcortical: Medium spiny neurons (striatum), dopaminergic (SNc/VTA), cholinergic
- Thalamic: Relay cells, reticular neurons
- Sensory: Rod, cone, bipolar, ganglion, amacrine (retina)
- Motor: Alpha motor neurons (spinal cord)
- Real-time spiking activity with clustered organization
- Color-coded neuron types with distinctive glyphs for each morphology
- Adjustable camera orbit controls
- Neuron inspector showing connectivity metrics and voltage traces
- Connection weight visualization
- Adjustable network size, connection probability, synaptic weights
- Support for excitatory/inhibitory neuron ratios
- Cluster-based topology with configurable inter/intra-cluster connectivity
- Template locking to preserve biologically accurate configurations
- JSON import/export with schema validation
- Python 3.8+ (for backend simulation)
- Modern web browser (Chrome, Firefox, or Edge recommended)
-
Clone the repository:
git clone https://github.com/venturaEffect/brain_emulation.git cd brain_emulation -
Install Python dependencies:
pip install -r requirements.txt
-
Start the SNN simulation server:
python server.py
The WebSocket server will start on
ws://localhost:8766 -
Serve the web interface:
python -m http.server 8000
-
Open the visualizer: Navigate to
http://localhost:8000/index.htmlin your browser
- Click the "Preset Templates" dropdown in the top bar
- Select a brain region (e.g., "Allen Motor Cortex BA4")
- The network will automatically configure with biologically realistic parameters
- Use "Lock Template" to prevent accidental modifications
- Orbit Camera: Click and drag to rotate view
- Zoom: Mouse wheel to zoom in/out
- Select Neuron: Click on any neuron to open the inspector panel
- Inject Spike: Select a neuron and click "Inject Spike" to manually trigger activity
- Show Weights: Toggle connection visualization for selected neuron
Available controls (when template is unlocked):
- Network Size: Total number of neurons
- Connection Probability: Likelihood of synaptic connections
- Firing Rate: Background spontaneous activity level
- Threshold: Spike generation threshold
- Cluster Count: Number of neuron clusters
- Excitatory Ratio: Percentage of excitatory vs inhibitory neurons
- Export: Click "Export" to download current network as JSON
- Import: Click "Import" and select a valid brain region template JSON file
- All exports include metadata with source references and provenance
brain_emulation/
├── server.py # Brian2 backend simulation server
├── test_network_modes.py # Testing script for simple/realistic modes
├── index.html # Main web interface
├── js/
│ ├── app.js # Core visualization and network logic
│ ├── templates/
│ │ ├── registry.js # Template registration system
│ │ ├── schema.js # JSON schema validation
│ │ └── config_io.js # Import/export functionality
│ └── three.min.js # 3D rendering library
├── css/
│ └── styles.css # UI styling (dark theme)
├── guides/ # Documentation (HTML format)
│ ├── guide1.html # Project Overview & Goals
│ ├── guide2.html # Quick Start & Environment Setup
│ ├── guide3.html # Interface Tour
│ ├── guide4.html # Controls & Parameter Panel
│ ├── guide5.html # Neuron Taxonomy & Glyph Dictionary
│ ├── guide6.html # Brain Regions & Template Library
│ ├── guide7.html # Simulation Pipeline & Runtime
│ ├── guide8.html # Importing & Exporting Atlas Data
│ ├── guide9.html # Neuron Inspector & Analytics
│ ├── guide10.html # Advanced Configuration & Manifest
│ ├── guide11.html # Troubleshooting & Verification
│ └── guide12.html # Glossary & Further Resources
├── data/
│ └── brain_region_maps/ # Atlas-based JSON templates
│ ├── allen_motor_cortex.json
│ ├── allen_prefrontal_cortex.json
│ ├── allen_somatosensory_cortex.json
│ ├── brainglobe_visual_cortex.json
│ ├── julich_thalamocortical_loop.json
│ └── manifest.json
└── docs/
├── realistic_network_guide.md # Realistic network integration guide
├── spiking_neural_network_simulator_development_guide.md
├── neuron_types.md
├── roadmap.md
├── mission.md
├── goals.md
├── ethics.md
└── archive/ # Archived lesson content
- Homogeneous neuron population
- Random connectivity
- Single synapse type
- Fast, basic dynamics for learning and experimentation
- 80% excitatory / 20% inhibitory neuron ratio (research-backed)
- Separate excitatory and inhibitory populations
- 4 synapse types: E→E, E→I, I→E, I→I
- Clustered connectivity with higher intra-cluster connections
- Biologically plausible firing patterns
- Based on neuroscience literature (Beaulieu & Colonnier 1985, Ramaswamy et al. 2021)
Switch between modes via WebSocket command:
ws.send(JSON.stringify({cmd: "setNetworkMode", mode: "realistic"}))All documentation is accessible through the Documentation dropdown in the interface, or directly from the guides/ folder:
- Project Overview & Goals - Mission, architecture, design principles
- Quick Start & Environment Setup - Installation, repository layout
- Interface Tour - Canvas, HUD controls, inspector, status bar
- Controls & Parameter Panel - Detailed reference for every slider and toggle
- Neuron Taxonomy & Glyph Dictionary - Neuron presets, biological names, glyphs
- Brain Regions & Template Library - Template schema, atlas sources, manifest workflow
- Simulation Pipeline & Runtime - How templates become networks
- Importing & Exporting Atlas Data - JSON round-tripping with validation
- Neuron Inspector & Analytics - Inspector cards, connectivity metrics, voltage traces
- Advanced Configuration & Manifest - Environment variables, template registration
- Troubleshooting & Verification - Diagnostic workflow, common fixes
- Glossary & Further Resources - Terminology and reference links
Additional technical documentation:
This project uses anatomical data from:
- Allen Brain Atlas: High-resolution brain maps with cell-type-specific data
- BrainGlobe: MNI152 atlas and standardized coordinate systems
- Julich-Brain / EBRAINS siibra: Cytoarchitectonic brain region definitions
- Neuroscience Literature: Research-backed neuron parameters and connectivity patterns
- Beaulieu, C., & Colonnier, M. (1985). A laminar analysis of the number of round‐asymmetrical and flat‐symmetrical synapses on spines, dendritic trunks, and cell bodies in area 17 of the cat
- Ramaswamy, S., et al. (2021). The neocortical microcircuit collaboration portal: a resource for rat somatosensory cortex
- Blue Brain Project: Detailed cortical simulation and modeling
- Human Brain Project: European brain research initiative
We welcome contributions! This project uses GitHub Discussions and branch protection to ensure quality.
🗣️ Start with Discussions for:
- New ideas and feature proposals
- Questions about implementation or neuroscience concepts
- Research discussions and brainstorming
- Getting help with the codebase
- All changes must go through pull requests (direct pushes to
mainare protected) - Use our issue templates for bugs and feature requests
- Follow the guidelines in CONTRIBUTING.md
See also: docs/instructions.md
- ✅ Interactive 3D SNN visualization
- ✅ 5 brain region templates from major atlases
- ✅ 30+ neuron types with distinct glyphs
- ✅ Simple and realistic network modes
- ✅ JSON import/export with validation
- ✅ Real-time parameter adjustment
- ✅ Neuron inspector with analytics
- STDP (Spike-Timing-Dependent Plasticity): Learning rules for synaptic modification
- Homeostatic Tuning: Self-regulating network stability mechanisms
- Multi-Region Networks: Connect multiple brain regions (e.g., sensory-motor loops)
- Structural Plasticity: Dynamic synapse formation/elimination
- Enhanced Atlas Integration: Direct API access to Allen/BrainGlobe databases
- Performance Optimization: GPU acceleration for larger networks (1000+ neurons)
- Advanced Visualizations: Oscillation analysis, raster plots, firing rate histograms
See docs/roadmap.md for detailed timeline.
# Test simple network
python test_network_modes.py simple
# Test realistic network
python test_network_modes.py realistic
# Test both modes sequentially
python test_network_modes.py simple --both- Start the server:
python server.py - Open the web interface
- Try loading each brain region template from the dropdown
- Verify neuron counts and connectivity match expected values
- Brian2: High-performance SNN simulation framework
- WebSockets: Real-time bidirectional communication
- NumPy: Numerical operations
- Three.js: WebGL-based 3D rendering
- Vanilla JS: No framework dependencies (lightweight and fast)
- JSON Schema: Template validation
WebSocket commands:
pause,play,speed: Simulation controlsetInput,setWeight,setConnectionProb: Parameter updatessetNetworkSize,reset: Network reconstructionsetNetworkMode: Switch between simple/realistic modestoggleWeights,injectPattern,testMemory: Interactions
Open source - see LICENSE
This project builds on research from:
- Carboncopies Foundation: WBE research coordination
- Blue Brain Project: Detailed cortical modeling
- Human Brain Project: European brain initiative
- OpenWorm: Complete organism simulation (C. elegans)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See
guides/folder or in-app documentation dropdown
Built with scientific rigor, open collaboration, and a vision for understanding the computational principles of biological intelligence.