Source-linked AI summary
BCIJelly: An integrated ecosystem for brain-computer interface research
Liyuan Han, Xinrui Yang, Tianyu Zheng, Qizhi Yang, Yitao Qin, Liang Chen, Qinglai Wei, Binjie Hong, Xinhe Zhang, Rui Xiong, Yong Gu, Mu-ming Poo, Bo Xu, Chengyu Li, Tielin Zhang
TL;DR
BCI research workflows remain fragmented across incompatible tools, limiting integration from neural recordings through decoder development and specialized-hardware deployment. BCIJelly unifies preprocessing, benchmark decoders, modular automated architecture search, hardware-aware deployment and visualization in one framework. It supports validation across five paradigms, three species and multiple decoding settings, while current framework limitations remain noted by the authors.
Problem
BCI research lacks an integrated workflow connecting preprocessing, decoder development and hardware deployment across fragmented tools.
Method
BCIJelly combines curated datasets, benchmark decoders, reusable modules, automated architecture search, LLM guidance, toChip deployment and graphical visualization.
Results
BCIJelly was validated across five BCI paradigms, three species, and single-task, multitask and cross-species decoding settings.
Takeaways & Limitations
BCIJelly establishes a unified and extensible infrastructure bridging decoder development and hardware-aware deployment for BCI research.
Takeaways & Limitations
The authors note several limitations of the current framework.
Abstract
from arXiv · showhide
Brain-computer interface (BCI) research relies on multistage computational pipelines, yet progress remains constrained by fragmented data formats, heterogeneous decoder implementations and hardware-specific deployment toolchains, and researchers lack an integrated workflow. Here, we fill this gap with BCIJelly, a unified computational ecosystem that integrates 18 curated BCI datasets, 15 benchmark decoders and an algorithmic library of 80 reusable modules, an automated architecture search (AAS) procedure, and hardware-aware deployment through the toChip pipeline within a single Python framework. AAS constructs task-specific decoders without manual architecture design. It is further extended into a closed-loop mode guided by a large language model (LLM), which uses task specifications, module descriptions and search history to support multitask and cross-species decoding. The toChip pipeline compiles trained decoders for execution on neuromorphic chips, enabling energy-efficient deployment for BCI systems. An accompanying visualization software provides a graphical interface to the full workflow, making BCIJelly accessible without programming. We validate BCIJelly across five BCI paradigms (motor, visual, speech, emotion and auditory) with recordings from humans, macaques and mice, and single-task, multitask and cross-species decoding settings. BCIJelly establishes a unified and extensible infrastructure that bridges decoder development and hardware-aware deployment for BCI research.
Introduction
BCI research tools address individual workflow stages, but researchers still lack a unified framework connecting preprocessing, decoder development and evaluation, and hardware deployment. BCIJelly integrates these capabilities with curated datasets, reusable modules, automated architecture search, hardware-aware deployment and visualization, and validates the ecosystem across diverse paradigms, species and decoding settings.
- Motivation: Existing BCI tools typically target individual workflow stages, leaving substantial integration effort to researchers.Available efforts cover data handling, standalone decoders or benchmarking, but do not combine the full workflow.
- Motivation: No single decoder is dominant across BCI paradigms or datasets, so architectures must be tested and tuned for each new task.The best-performing model often differs from one dataset to the next.
- Motivation: Low-power BCI operation motivates deploying trained decoders on efficient edge or neuromorphic hardware rather than relying exclusively on GPUs.This hardware requirement is identified as a central practical challenge for BCI research.
- Contribution: BCIJelly integrates preprocessing, benchmark decoders, automated architecture search and hardware-aware deployment within a single Python framework.The ecosystem includes 18 curated BCI datasets, 15 complete decoders and 80 reusable modules.
- Contribution: AAS constructs task-specific decoders without manual architecture design, while its LLM-guided extension supports search planning, failure diagnosis and multitask settings.The closed-loop procedure uses task specifications, module descriptions and search history.
- Validation: Validation spans five BCI paradigms, three species, and single-task, multitask and cross-species decoding settings.The framework also compiles trained decoders for neuromorphic chips and provides graphical access to the workflow without programming.
Overview of the BCIJelly computational ecosystem
BCIJelly presents a modular ecosystem that exposes data processing, decoder construction, hardware deployment and visualization through a unified workflow. Its reusable components support established baselines and automatically generated task-specific architectures.
- Data processing: BCIJelly standardizes heterogeneous BCI datasets across five paradigms and supports both classification and regression analyses.The framework exposes these data-processing functions through a unified API.
- Model library: Its model library has algorithm-level complete decoders for baselines and module-level components that can be composed into new architectures.The module pool includes convolutional, residual, attention and fully connected components.
- Automated architecture search: AAS samples, assembles and evaluates module combinations to generate task-specific decoders without manual architecture design.The search procedure automates much of architecture construction.
- Hardware deployment: Trained GPU models are compiled and deployed onto neuromorphic chips including TaiBai and Lynxi HE200, with FPGAs serving as presilicon prototypes.This hardware-aware path is part of the integrated computational workflow.
- Visualization: Interactive visualization software provides a graphical interface for data import and export, signal visualization, electrode localization and data analysis.A representative Python workflow connects dataset loading, decoder training, neuromorphic conversion and signal visualization.
Preprocessing of standardized data across paradigms and species
BCIJelly converts heterogeneous recordings into standardized multichannel spike-train inputs using task-specific binning strategies. Across four representative datasets, binning preserved spike counts and closely retained neural representation structure.
- Scope: BCIJelly supports five BCI paradigms with datasets recorded from humans, macaques and mice.The standardized preprocessing pipeline is designed for heterogeneous recordings across paradigms and species.
- Spike-train conversion: Continuous voltage recordings are bandpass filtered between 250 and 5,000 Hz, thresholded adaptively per channel, and assembled into multichannel spike trains.The adaptive thresholds retain events between μ ± 4σ and μ ± 8σ.
- Validation: Pearson r = 1.00 for total spike counts before and after binning across four representative datasets.The result indicates that no spikes were lost during binning.
- Validation: Spearman r = 0.94 to 0.99 with Mantel test p < 0.001 for pairwise distance structures between raw and binned representations.The binned representation therefore retains the temporal and geometric structure of the original neural activity while providing a compact model input.
A modular model library and automated architecture search
BCIJelly combines an 80-module library with benchmark decoders and automated architecture search because decoder performance varies across datasets and evaluation settings. AAS explores distinct module combinations and identifies competitive models with limited evaluations.
- Module library: The 80-module library is organized into fully connected, backbone, convolutional and attention functional categories.These modules form the basis for established and newly composed decoding architectures.
- Module library: Reusable modules can be freely recombined to generate architectures beyond those already included in BCIJelly.This extends the library from a collection of reference models to a space for composing new architectures.
- Benchmarking: Benchmark decoders including LSTM, Transformer, LFADS, Cycle-GAN and Stabilization show no dominant architecture across paradigms or evaluation settings.The best-performing architecture changes from one dataset to the next, motivating automated architecture selection.
- Automated architecture search: AAS iteratively samples, trains and validates candidate architectures, retains those exceeding a threshold, and combines retained candidates for held-out testing.The search stops after collecting K valid candidates or reaching a maximum number of rounds.
- Search behavior: Five searches explored very different module combinations while consistently producing strong decoders, despite limiting each search to no more than six candidate evaluations.Different runs converged to distinct module combinations.
- Search performance: 0.71 median accuracy was achieved on the classification task across 11 held-out test days, while median R² reached 0.80 on regression across 13 held-out test days.The test days spanned 35 and 88 days, respectively.
Closed-loop AAS with large language models
BCIJelly extends automated architecture search into a closed-loop LLM-guided process that plans, evaluates, diagnoses and refines task-specific decoders. Across single-task, multitask and cross-species settings, searched decoders were generally competitive with pretrained baselines, with significant gains in selected joint-training settings.
- Search pipeline: The closed-loop AAS pipeline uses task specifications, module descriptions and search history to guide decoder construction.The LLM pretrains a shared encoder, freezes it, and assembles candidate decoders for evaluation.
- Results: LLM-driven AAS decoders were competitive with state-of-the-art pretrained models and exceeded them in selected cross-species settings.The largest differences occurred in cross-species joint training, particularly for Jango and Reaching B.
- Results: On Jango and Reaching B cross-species joint-training settings, searched decoders scored significantly higher than the best pretrained baseline (paired t-test, P < 0.05).On Indy, NDT1 scored significantly higher in macaque-and-mouse and all-species settings; the three LLM backends did not differ significantly.
- Results: UniBCI matched the best pretrained baselines on Finger PPC and Visual Coding without a significant difference but scored below state-of-the-art baselines on other datasets.It achieved the highest numerical scores on Finger PPC in several settings.
Hardware-aware deployment across heterogeneous platforms
BCIJelly provides a unified pipeline for compiling trained ANN and SNN decoders across heterogeneous hardware. Deployment preserved decoding performance while neuromorphic platforms substantially reduced power consumption relative to a GPU.
- Pipeline: BCIJelly addresses the engineering burden of deploying decoders across hardware with different native operator sets through a unified deployment pipeline.The conversion API selects ANN or SNN deployment with a single argument.
- Pipeline: ANN models are parsed into hardware-ready graphs and compiled, while SNN models first undergo node conversion into spike-based equivalents.Both model types then follow the same parsing and compilation steps for the selected platform.
- Platform support: Standard ANN decoders compiled to the GPU or Lynxi without architectural modification because their building modules were natively supported.The supported modules span convolution, batch normalization, fully connected layers, recurrent units and attention.
- Platform support: SNN decoders ran on the GPU, Lynxi and TaiBai, making both neuromorphic chips suitable deployment targets for spiking models.Their native support includes spike-driven inference and sparse weight encoding.
- Deployment results: Decoding accuracy was essentially identical across the GPU, Lynxi and TaiBai, confirming that operator conversion preserved model performance.The deployment evaluation used the MFSNN algorithm on all three platforms.
A graphical interface for the BCIJelly workflow
BCIJelly includes graphical software for interactively inspecting neural recordings, configuring preprocessing and decoders, and comparing predictions with behavior. The interface exposes the full workflow from raw signals to decoded behavior without programming.
- Interface: The visualization software provides a graphical front end for neural signal inspection, spike detection, decoder configuration and decoding-output visualization.It supports recordings from humans, macaques and mice across the paradigms supported by BCIJelly.
- Signal inspection: Users can select channels, locate recording sites on species-specific 3D brains, watch behavioral video and inspect multichannel LFP traces with recording statistics.Displayed statistics include sampling rate and total duration.
- Signal inspection: Interactive spike detection exposes adjustable bandpass cutoffs and threshold levels, overlaying detected spikes on LFP traces for immediate feedback.Preprocessing and parameters are controlled within the graphical interface.
- Decoding: Any decoder in the BCIJelly library can be loaded for a chosen task and compared directly with ground-truth behavior.The library includes MLP, GRU, UNet, LSTM, Transformer, LFADS, Stabilization and Cycle-GAN decoders.
- Decoding: The interface visualizes both discrete reach-direction classification and continuous reach-trajectory regression alongside their behavioral targets.Classification displays predicted selection among eight targets, whereas regression displays reconstructed continuous trajectories.
Discussion
BCIJelly unifies BCI data processing, decoder development, automated architecture search, visualization and neuromorphic deployment in one ecosystem. Its scope spans diverse paradigms, species and decoding settings, while current limitations concern modality coverage, decoder classes, hardware support, search evaluation and platform availability.
- Integrated ecosystem: BCIJelly integrates preprocessing, benchmark decoders, automated architecture search, hardware-aware deployment and visualization within a single Python framework.The ecosystem spans the workflow from raw neural recordings through decoder development to hardware execution.
- Automated decoder design: Its 80-module library and automated architecture search construct task-specific decoders without manual architecture design, including guided single-task, multitask and cross-species designs.The LLM-driven extension generalizes search beyond random sampling from a fixed module library.
- Deployment and accessibility: The toChip pipeline carries trained decoders toward neuromorphic execution, while the visualization platform exposes the full workflow through a graphical interface without programming.BCIJelly targets low-power deployment, and some AAS-produced decoders were deployed on neuromorphic chips.
- Validation scope: BCIJelly was validated across five BCI paradigms using recordings from humans, macaques and mice, including single-task, multitask and cross-species settings.The framework is presented as extensible infrastructure for diverse BCI workflows.
- Design rationale: The framework addresses decoder variability across datasets and paradigms by assembling task-specific architectures rather than committing to a fixed decoder.Searched encoder-decoder models showed comparable performance to pretrained baselines, while performance varied substantially across datasets and paradigms.
- Limitations: Current limitations include emphasis on invasive recordings, only one included spiking decoder, two targeted neuromorphic platforms, and no deployment of LLM-driven models with Transformer blocks.The visualization platform currently runs on Windows only, and the LLM-driven search was run once per task under a fixed pipeline seed.
Datasets and standardized preprocessing.
BCIJelly standardizes diverse BCI recordings through curated datasets, signal preprocessing, task-specific binning, and reusable decoder modules with automated architecture search.
- Datasets: 13 motor BCI datasets cover four task categories, while additional datasets span visual, speech, auditory and emotion paradigms.The visual datasets include mouse and macaque recordings; speech and auditory recordings are human, and emotion recordings are from a macaque.
- Signal preprocessing: Raw voltage traces are bandpass filtered with a zero-phase Butterworth filter before channel-wise spike detection.Detection uses sliding windows and two amplitude bounds around the local mean and standard deviation.
- Signal preprocessing: Spikes are registered when ασ < |V(t) − μ| < βσ, with a refractory period preventing duplicate detection.Filter settings, window size, threshold multipliers and refractory period are configured per dataset.
- Binning: Classification trials use adaptive binning to produce a common channels × S output shape, whereas regression uses a uniform bin size across trials.Final incomplete bins are zero-padded, and binned spike trains are formed by counting spikes within each bin.
- Decoder construction: BCIJelly provides 80 reusable modules across attention, backbone, convolutional and fully connected categories for decoder construction.The library contains 39 attention, 29 backbone, 6 convolutional and 6 fully connected modules.
- Automated architecture search: Automated architecture search samples, trains and validates candidate decoders, retains threshold-exceeding candidates, and ensembles the top performers.Candidates are constrained by module-category diversity, and final predictions are averaged on the held-out test set.
LLM–driven AAS. All decoders were built on a single shared encoder (Extended
LLM-driven AAS uses a shared encoder and task-specific module search to construct decoders, with safeguards for scalable, reproducible evaluation. The framework also provides benchmark implementations, deployment integration, and visualization.
- The shared encoder maps neural recordings to a common feature representation before task-specific decoder training.
- LLM-driven AAS uses task specifications, module descriptions and architecture history to guide decoder search and refinement.
- The search can design new executable modules, safety-check them, and retain successful modules for later searches.
- The LLM sees a fixed-size, performance-ranked module slice while the full library and search history remain stored, keeping context tractable as the library grows beyond 100 modules.
- With context held at about 43 modules while the library grew beyond 100, search accuracy did not degrade without retraining or retuning.
- AAS samples architectures, trains and validates candidates, retains top performers, and selects an ensemble decoder for testing.
Supplementary Tables
The supplementary material specifies the datasets, splits, search procedure, ensemble selection, evaluation outputs, and benchmark decoder families used in BCIJelly.
- AAS procedure: The AAS samples constrained candidate architectures, trains them on D_train, evaluates them on D_val, and retains candidates meeting validation thresholds.
- AAS procedure: AAS keeps the top retain_top_k candidates, selects ensemble_top_m candidates, and chooses the ensemble with the best validation metric.
- Evaluation: For external evaluation, the selected ensemble is applied to each held-out test day, reporting day-wise, average, median and minimum metrics.
- Benchmark decoders: The benchmark collection spans linear, shallow, recurrent, transformer, latent-variable, cross-day-alignment and spiking decoder families.
Supplementary Notes
The supplementary notes document dataset- and decoder-specific training overrides used for regression, classification, and cross-day analyses.
- Regression analyses: FALCON M2 regression analyses used decoder-specific overrides for LFADS, Stabilization, Cycle-GAN, Transformer, FENet and DFINE.
- Cross-day analyses: Cross-day analyses applied calibration, alignment, batch-size, epoch, learning-rate and patience overrides across multiple datasets and decoder families.
- Regression analyses: seqVAE regression runs on FALCON M2, LINK CO, LINK RTT and Indy used seed=44 and recorded both single-day and per-test-day cross-day results.
- Classification analyses: Classification analyses used dataset-specific seeds, batch sizes, normalization, training steps and evaluation intervals for MLP, MFSNN and related decoders.