Official codebase for the paper:
SPINT: Spatial Permutation-Invariant Neural Transformer for Consistent Intracortical Motor Decoding
Trung Le, Hao Fang, Jingyuan Li, Tung Nguyen, Lu Mi, Amy Orsborn, Uygar Sumbul, Eli Shlizerman
NeurIPS 2025
Intracortical brain-computer interfaces (iBCIs) translate neural population activity into motor commands, yet their long-term utility is constrained by recording nonstationarity: shifts in the composition and tuning of recorded units across sessions progressively degrade decoders trained on prior data. We introduce SPINT, a Spatial Permutation-Invariant Neural Transformer whose context-dependent representations are invariant to the size and ordering of recorded units, supporting few-shot adaptation to unseen sessions without parameter updates. SPINT achieves state-of-the-art cross-session decoding on the FALCON benchmark across three intracortical motor tasks while being gradient-free and using minimal unlabeled calibration trials.
Prerequisites: Mamba (or Conda) and Docker.
bash setup.sh
mamba activate spintSPINT was evaluated using the FALCON benchmark datasets, hosted on DANDI:
| Task | DANDI ID |
|---|---|
| M1 | 000941 |
| M2 | 000953 |
| H1 | 000954 |
Download the dandisets into data/ at the repo root, i.e., <repo>/data/000941/, <repo>/data/000953/, <repo>/data/000954/.
To train with default hyperparameters (replace <task> with m1, m2, or h1):
python src/train.py data=falcon_<task> model=falcon_<task>If needed, override any hyperparameter from the command line, e.g.,
python src/train.py data=falcon_m1 model=falcon_m1 trainer=gpu model.optimizer.lr=1e-4 trainer.max_epochs=50 <...>(see configs/ for tunable hyperparameters)
- Package a trained model as a decoder (replace with desired checkpoint epoch):
python third_party/falcon_challenge/spint_decoder.py \
--run_dir logs/train/runs/<run_id> \
--checkpoint epoch_<NNN>.ckpt
# saves to local_data/spint_<task>.pkl--checkpoint accepts a bare filename (searched under checkpoints/best_ckpt/ then checkpoints/periodic_ckpt/), a path relative to the run dir, or an absolute path.
- Run local evaluation (recommended values for
--batch-size: M1=4, M2=7, H1=8):
python third_party/falcon_challenge/spint_sample.py \
--evaluation local \
--model-path local_data/spint_<task>.pkl \
--split <task> \
--phase minival \
--batch-size <batch_size>Build the Docker image:
docker build --build-arg TASK=<task> --build-arg BATCH_SIZE=<batch_size> \
-t spint_<task>:latest -f third_party/falcon_challenge/spint_sample.Dockerfile .Submitting to the FALCON challenge needs the evalai CLI. Due to a dependency conflict with the SPINT env, install it in its own Python 3.6 environment:
mamba create -n evalai -c conda-forge python=3.6 -y
mamba activate evalai
pip install evalai
evalai set_token <your-token> # from https://eval.ai/web/profileThen push:
evalai push spint_<task>:latest --phase few-shot-test-2319 --private@inproceedings{le2025spint,
title={SPINT: Spatial Permutation-Invariant Neural Transformer for Consistent Intracortical Motor Decoding},
author={Le, Trung and Fang, Hao and Li, Jingyuan and Nguyen, Tung and Mi, Lu and Orsborn, Amy and S{\"u}mb{\"u}l, Uygar and Shlizerman, Eli},
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
year={2025}
}Evaluation code (third_party/falcon_challenge/) is adapted from the FALCON challenge (MIT License). We thank the FALCON challenge organizers for the benchmark, datasets, and technical support with the submissions.
The repo scaffolding (Hydra configs, Lightning entry points, callbacks, and logging utilities) is built on top of the template at ashleve/lightning-hydra-template (MIT License).
Distributed-training sampler code (third_party/catalyst/) is adopted from catalyst-team/catalyst v21.5 (Apache License 2.0).
This project is licensed under the BSD Modified License (BSD 3-Clause). See LICENSE for details.
Copyright (c) 2024-2026 University of Washington. Developed in UW NeuroAI Lab.