BioNet: A Python interface to NEURON for modeling large-scale networks

Sergey L. Gratiy, Yazan N. Billeh, Kael Dai, Catalin Mitelut, David Feng, Nathan W. Gouwens, Nicholas Cain, Christof Koch, Costas A. Anastassiou, Anton ArkhipovPLoS 2018

Abstract

There is a significant interest in the neuroscience community in the development of large-scale network models that would integrate diverse sets of experimental data to help elucidate mechanisms underlying neuronal activity and computations. Although powerful numerical simulators (e.g., NEURON, NEST) exist, data-driven large-scale modeling remains challenging due to difficulties involved in setting up and running network simulations. We developed a high-level application programming interface (API) in Python that facilitates building large-scale biophysically detailed networks and simulating them with NEURON on parallel computer architecture. This tool, termed "BioNet", is designed to support a modular workflow whereby the description of a constructed model is saved as files that could be subsequently loaded for further refinement and/or simulation. The API supports both NEURON's built-in as well as user-defined models of cells and synapses. It is capable of simulating a variety of observables directly supported by NEURON (e.g., spikes, membrane voltage, intracellular [Ca++]), as well as plugging in modules for computing additional observables (e.g. extracellular potential). The high-level API platform obviates the time-consuming development of custom code for implementing individual models, and enables easy model sharing via standardized files. This tool will help refocus neuroscientists on addressing outstanding scientific questions rather than developing narrow-purpose modeling code.

Introduction

Modern neuroscience is increasingly data-rich, benefiting from high-resolution reconstructions of single-neuron morphologies and massive recordings of circuit activity. To synthesize these data into a coherent understanding of neural computation, researchers require large-scale, biophysically detailed models. However, a significant "coding bottleneck" persists. While the NEURON simulator is a powerful industry standard, configuring large networks often requires low-level scripting in legacy HOC or complex Python. This results in idiosyncratic, hard-to-reproduce code. BioNet addresses this by providing a standardized, high-level Python interface that transforms model building from a custom craft into a scalable engineering workflow.

Methods and Implementation

BioNet is a core component of the Brain Modeling Toolkit (BMTK), built upon a modular architecture that separates network construction from simulation.

Workflow Separation

The workflow is divided into two distinct phases:

  1. Building: A "Builder" defines nodes (neurons) and edges (synapses) using a query-based API (e.g., add_nodes, add_edges). These definitions are saved to disk as standardized binary tables (HDF5/CSV).
  2. Simulation: A "Simulator" loads these files to execute the computation. This separation allows researchers to modify simulation parameters—such as stimulus types or recording sites—without re-calculating the complex connectivity of a 100,000-neuron network.

Scaling and Parallelization

BioNet is designed for high-performance computing (HPC). It automatically distributes cells across multiple processors using a "round-robin" approach. This ensures balanced computational load across clusters without requiring the user to manually manage Message Passing Interface (MPI) calls.

Virtual Electrophysiology

To bridge the gap between "in silico" and "in vivo" experiments, BioNet includes an integrated module for calculating extracellular potentials (e.g., Local Field Potentials or virtual electrode spikes) using the line-source model. These observables are calculated during the simulation loop, enabling real-time comparison with experimental data.

Benchmarking and Results

The utility of BioNet was demonstrated through the construction of a mouse primary visual cortex (V1) Layer 4 model. This benchmark included 10,000 biophysically detailed cells and 35,000 Point Leaky Integrate-and-Fire (LIF) cells, driven by pre-computed spike trains from the Lateral Geniculate Nucleus (LGN).

Performance and Scaling

BioNet demonstrated near-ideal linear scaling up to 1,000 CPU cores. As the number of processors increased, the simulation "wall time" decreased proportionally, proving its efficiency for massive networks. Furthermore, the "type-instance" data model—where shared properties like ion channel densities are stored once per type—significantly reduced the memory footprint.

Biological Realism

The V1 model successfully replicated key biological phenomena, including orientation selectivity in excitatory neurons and ~20 Hz gamma oscillations, aligning with established experimental observations.

Discussion and Limitations

BioNet streamlines the transition from individual data points to integrated circuit models. However, several areas for future development remain. Currently, BioNet is tightly coupled with the NEURON simulator; extending support to other backends like NEST or Arbor would increase its versatility. Additionally, while the simulation scales well, calculating extracellular potentials for more than 1,000 electrode sites introduces a computational bottleneck. Finally, as models approach the million-neuron scale, optimizing I/O operations for HDF5 files will be critical to maintaining performance.

By providing a high-level API and standardized file formats, BioNet enables the neuroscience community to focus on scientific discovery rather than the complexities of low-level simulation code.

Summary updated

BibTeX
@inproceedings{gratiy2018bionet,
  author = {Sergey L. Gratiy and Yazan N. Billeh and Kael Dai and Catalin Mitelut and David Feng and Nathan W. Gouwens and Nicholas Cain and Christof Koch and Costas A. Anastassiou and Anton Arkhipov},
  title = {{BioNet: A Python interface to NEURON for modeling large-scale networks}},
  booktitle = {PLoS},
  year = {2018},
  doi = {10.1371/journal.pone.0201630},
}
Figure