Ephys feature extraction from NWB files and Channel Region prediction
A classifier trained on IBL data applied to Allen (AIND) Neuropixels-1.0 recordings
Pranav Rai
17.07.2026
NDRH’26
Objective & approach
Goal
• Such a tool can be used in real time localization of the probes in the brain.
• Measure how an IBL-trained brain-region decoder generalizes to a different lab's rig (Allen / AIND).
Three data sources tied together
• No datasets exist on DANDI which have raw AP and LF data for mice.
• Raw AP+LF — streamed from AIND public S3 (WavPack-Zarr), not downloaded
• Region labels — DANDI 001637 electrodes table (Allen acronym per channel)
• Training — ea_active vintage 2026_W26 (383k channels / 998 IBL probes)
Thanks to Carter for helping with access of the Data
Method
• Full feature set: 49 features (LF, CSD, AP, spike-detection)
• 5 × 5 s snippets per probe, aggregated + denoised
• XGBoost model trained on IBL data
Two metrics reported:
• all-channel (headline, incl. out-of-brain) vs in-brain (real regions only)
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions
Predictive Procesing Allen Open Scope
Dataset: OpenScope Community Predictive Processing (DANDI 001637), Neuropixels, mouse sensory mismatch
Repository architecture — modular feature calculators
One compute workflow; each data source is a small plug-in — stream or read locally, same pipeline
Class hierarchy (src/ephysatlas/feature_calculators/)
BaseFeatureCalculator
abstract source API + shared compute_snippet()
│
├─ SpikeGlxLikeFeatureCalculator (spikeglx.Reader)
│ ├─ SpikeGLXFileFeatureCalculator local SpikeGLX
│ └─ IBLPIDFeatureCalculator IBL via ONE
│
└─ SpikeInterfaceFeatureCalculator (SI BaseRecording)
├─ NwbFeatureCalculator NWB: local·URL·DANDI
└─ AllenAindFeatureCalculator AIND zarr on S3 ★
Point it at your data — same call, any source
local file NwbFeatureCalculator.from_local(ap_path, lf_path)
stream URL NwbFeatureCalculator.from_url(ap_url, lf_url)
DANDI asset NwbFeatureCalculator.from_dandi("000409",
ap_filepath=…, lf_filepath=…)
IBL probe IBLPIDFeatureCalculator(pid, one=one)
AIND S3 ★ AllenAindFeatureCalculator(ap_url, lf_url)
then, identical for every source:
calc.compute_snippet(
SnippetWindow(t_start, duration_ap, duration_lf),
FeatureComputationOptions(
features_to_compute=["lf","csd","ap","waveforms"]))
Add a source = implement one open-recording hook; geometry, snippet slicing, channel metadata & feature computation are inherited. Acquisition (local / URL / DANDI, HDF5 / Zarr) is composed via NwbSource, not subclassed.
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions
Result: transfer ≈ IBL generalization
Crossing the IBL→Allen lab gap costs almost nothing beyond normal probe-to-probe variability
Takeaways
• Accuracy grouped by probe (mean ± sd over 129 probes)
• Allen all-channel 0.58 ± 0.13 = IBL across-probe (grouped-by-PID) CV 0.58
• In-brain 0.67 ± 0.15
• Chance = 0.08 (1 of 12 regions)
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions
How accuracy varies across probes & sessions
Median per-probe 0.57 all-channel / 0.68 in-brain; best probes exceed 0.80
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions
Example predictions
Example predictions
Example predictions - Bad predictions
Which regions transfer — and where errors go
Hippocampus & cortex transfer strongly; thalamus & olfactory collapse into cortex/HPF
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions
Key findings & limitations
Findings
• Small domain gap — IBL→Allen transfer matches held-out-probe IBL CV (both 0.58)
• HPF 0.91 and Isocortex 0.74 transfer strongly (robust laminar / theta-ripple signatures)
• Full feature set + matched denoising closes the gap that limited the LFP-only attempt
Things to do
• Thalamus (0.18) & olfactory (0.00) poorly detected — main headroom
• Weak out-of-brain (void) detection drags the all-channel number down
• Check with different probe geometries, and with more powerful models.
• Try with more powerful models.
• Create a plugin for acquisition softwares like SpikeGLX or Openephys.
ephys-atlas 2026_W26 Cosmos classifier · Allen (AIND) NP1 · 129 probes / 23 sessions