VickM's picture
Update README.md
6bbdc56 verified
|
Raw
History Blame Contribute Delete
4.65 kB
metadata
license: mit
library_name: pytorch
tags:
  - spiking-neural-network
  - neuroscience
  - connectome
  - drosophila
  - olfaction
  - norse
  - biology
datasets:
  - MIRE-org/door-olfactory-responses
pipeline_tag: tabular-classification

FlyWire Olfactory SNN (MaskedRecurrentLIFSNN)

A connectome-constrained recurrent spiking neural network for odor identity classification in Drosophila melanogaster, trained on the DoOR olfactory receptor response dataset.

Model description

The recurrent connectivity of this SNN is fixed to the FlyWire connectome subgraph (antennal lobe projection neurons + mushroom body Kenyon cells). Synaptic signs (excitatory/inhibitory) come from predicted neurotransmitter types in FlyWire. Only the weight magnitudes are learned; the topology is biological.

Architecture

Input: odor receptor vector (DoOR: ~52 receptors)
  β†’ Linear(input_dim β†’ hidden_dim, no bias)
  β†’ 20 LIF timesteps with:
      β€’ Poisson spike encoding from rate-coded input
      β€’ Recurrent current: spk Γ— (W_rec βŠ™ mask βŠ™ sign)α΅€
      β€’ Norse LIFCell (surrogate gradient, Ξ±=100)
  β†’ time-averaged spike rates
  β†’ Linear(hidden_dim β†’ num_classes)
  • Neuron model: Leaky Integrate-and-Fire (Norse LIFCell, method="super")
  • Recurrent mask: Binary from FlyWire adjacency (fixed, not learned)
  • Synaptic signs: ACh/DA/5-HT/OA β†’ +1 (excitatory); GABA/Glu β†’ βˆ’1 (inhibitory)
  • Training: Adam optimizer, CrossEntropyLoss, surrogate gradients through LIF

Files

File Description
model.safetensors Trained weights (best validation checkpoint)
config.json Architecture hyperparameters
connectome_mask.npz FlyWire olfactory subgraph (binary adjacency + signs)
connectome_meta.json Connectome metadata (neuron count, edge count, source)
modeling_snn.py Standalone MaskedRecurrentLIFSNN class

Usage

import scipy.sparse as sp
import torch
from safetensors.torch import load_file

# Load the model
from modeling_snn import MaskedRecurrentLIFSNN

adjacency = sp.load_npz("connectome_mask.npz")
model = MaskedRecurrentLIFSNN(
    input_dim=52,       # from config.json
    hidden_dim=800,     # from config.json
    num_classes=500,    # from config.json
    adjacency=adjacency,
    steps=20,
    alpha=100.0,
)
state_dict = load_file("model.safetensors")
model.load_state_dict(state_dict)
model.eval()

# Inference
x = torch.randn(1, 52)  # receptor activation vector
logits, spike_sparsity = model(x)
predicted_odor = logits.argmax(dim=1).item()

Training details

  • Dataset: DoOR (Database of Odorant Responses) β€” CC BY-SA 4.0
  • Cross-validation: 5-fold over odor identities Γ— 5 seeds = 25 runs
  • Early stopping: patience 5 on validation accuracy
  • Optimizer: Adam (lr=1e-3, weight_decay=1e-5)
  • Batch size: 32
  • Max epochs: 80
  • SNN timesteps: 20
  • Evaluation: 5Γ— Monte Carlo averaging over stochastic Poisson encoding

Connectome-Constrained Spiking Neural Networks Olfactory Classification Study

This model was used in a classification study and ran against a comparable but shuffled spiking neural network Sparse MLP, and Dense MLP models.

Summary Results may be found here: https://mire-institute.org/research-papers/connectomeconstrained-spiking-neural-networks-olfactory-classification-study

And the full research paper may be found here: https://mire-institute.org/research-papers/connectomeconstrained-spiking-neural-networks-olfactory-classification-study-preprint

Biological basis

The model's recurrent topology is extracted from the FlyWire whole-brain connectome of Drosophila melanogaster (FAFB dataset). The olfactory subgraph includes:

  • Antennal Lobe Projection Neurons (ALPN): relay processed odor information
  • Kenyon Cells (KC): mushroom body neurons for associative olfactory memory

This captures the AL β†’ PN β†’ KC pathway that the fly uses for odor discrimination and learning.

Citation

If you use this model, please cite: