Downloads · 30 days
21
46% of all-time downloads
MIRE-org/flywire-olfactory-snn
flywire-olfactory-snn is a tabular classification model from MIRE-org. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A connectome-constrained recurrent spiking neural network for odor identity classification in Drosophila melanogaster, trained on the DoOR olfactory receptor response dataset.
Downloads · 30 days
21
46% of all-time downloads
All-time downloads
46
Public
Parameters
2.5M
10.1 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors10.1 MB · 99%
From the Hugging Face model README
A connectome-constrained recurrent spiking neural network for odor identity classification in Drosophila melanogaster, trained on the DoOR olfactory receptor response dataset.
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.
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)
LIFCell, method="super")| 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 |
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()
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
The model's recurrent topology is extracted from the FlyWire whole-brain connectome of Drosophila melanogaster (FAFB dataset). The olfactory subgraph includes:
This captures the AL → PN → KC pathway that the fly uses for odor discrimination and learning.
If you use this model, please cite: