Source-linked AI summary

BindsNET: A machine learning-oriented spiking neural networks library in Python

Hananel Hazan, Daniel J. Saunders, Hassaan Khan, Darpan T. Sanghavi, Hava T. Siegelmann, Robert Kozma

arXiv:1806.01423v2cs.NEq-bio.NC

TL;DR

Spiking neural networks have not been widely applied to machine learning and reinforcement learning problems. The paper presents BindsNET, an open-source package for rapid biologically inspired prototyping, and argues that its machine-learning-oriented tools can support further research.

  • Problem

    Spiking neural networks have not been widely applied to machine learning and reinforcement learning problems.

  • Method

    The paper presents BindsNET, an open-source package for rapid biologically inspired prototyping with machine and reinforcement learning applications in mind.

  • Results

    The paper shows that spiking neural networks can in principle compete with deep learning methods and achieve competitive performance on standard image classification benchmarks.

  • Takeaways & Limitations

    BindsNET combines machine-learning programming tools with neuroscientific ideas to facilitate further integration of biological neural networks and machine learning.

  • Takeaways & Limitations

    BindsNET is still at an early stage of development, leaving substantial room for future work and improvement.

Abstract

from arXiv · show

The development of spiking neural network simulation software is a critical component enabling the modeling of neural systems and the development of biologically inspired algorithms. Existing software frameworks support a wide range of neural functionality, software abstraction levels, and hardware devices, yet are typically not suitable for rapid prototyping or application to problems in the domain of machine learning. In this paper, we describe a new Python package for the simulation of spiking neural networks, specifically geared towards machine learning and reinforcement learning. Our software, called BindsNET, enables rapid building and simulation of spiking networks and features user-friendly, concise syntax. BindsNET is built on top of the PyTorch deep neural networks library, enabling fast CPU and GPU computation for large spiking networks. The BindsNET framework can be adjusted to meet the needs of other existing computing and hardware environments, e.g., TensorFlow. We also provide an interface into the OpenAI gym library, allowing for training and evaluation of spiking networks on reinforcement learning problems. We argue that this package facilitates the use of spiking networks for large-scale machine learning experimentation, and show some simple examples of how we envision BindsNET can be used in practice. BindsNET code is available at https://github.com/Hananel-Hazan/bindsnet

1 Introduction

Spiking neural networks offer biologically inspired capabilities for machine learning, but existing tools often hinder rapid prototyping and ML experimentation. BindsNET addresses this gap with a concise Python interface built for SNN machine and reinforcement learning applications.

  • SNNs integrate inputs over time and use binary communication, features associated with temporal processing and energy-efficient hardware simulation.
  • Recent studies report that SNNs can compete with deep learning methods on image-recognition and standard image-classification benchmarks.
  • Existing SNN software often targets biological realism or specialized hardware rather than rapid machine learning prototyping.
  • BindsNET is a PyTorch-based Python library for building, training, and evaluating SNNs with biologically motivated learning algorithms.
  • BindsNET includes an OpenAI Gym interface and modules for reinforcement-learning interaction, dataset handling, spike encoding, visualization, and model evaluation.

2 Review

SNN simulation frameworks span biologically detailed software, high-level ML systems, and specialized hardware, but they impose different trade-offs in realism, flexibility, performance, and usability. The review motivates BindsNET’s focus on consistent, accessible prototyping for machine learning.

  • Existing SNN frameworks differ in biological realism, abstraction level, target hardware, and suitability for machine learning experimentation.
  • BindsNET favors easy development, debugging, execution, open-source access, and continuity within a single programming language.
  • Biophysically detailed simulators model components from subcellular processes to multicompartment neurons but may require homogeneous component types.
  • BRIAN, ANNarchy, and NEST support differential-equation-based neuron and connection dynamics, while significant behavioral changes can require underlying-code modification.
  • BindsNET does not currently solve arbitrary differential equations for neural dynamics and instead supports several popular neuron types.
  • High-level platforms such as NeuCube and Nengo support ML or cognitive modeling, whereas CARLsim and NeMo emphasize large GPU-accelerated spiking networks.
  • Hardware SNN platforms can improve performance and power consumption but may constrain experiments through platform-specific languages, connectivity, or configuration limits.

3 Package structure

BindsNET organizes spiking-network simulation, learning, datasets, environments, evaluation, and pipeline coordination into modular components built for machine-learning experimentation.

  • Core simulation: BindsNET uses PyTorch tensors for neuron state variables and supports GPU computation through device-transfer and default-tensor configuration.State variables such as spikes and voltages are stored and updated as tensors.
  • Core simulation: The Network coordinates Nodes, Connections, synchronous time-step updates, state resets, monitors, and saving or loading functionality.Nodes include input, integrate-and-fire, leaky integrate-and-fire, and Izhikevich implementations.
  • Core simulation: Connections define weighted interactions between source and target neuron groups and can use Hebbian learning, STDP, reward-modulated STDP, normalization, or convolutional operations.Sparse connections are available, but the passage notes that they do not yet support learning functions.
  • Machine and reinforcement learning: The learning and environment modules support machine learning and reinforcement learning through biological update rules, Gym wrappers, dataset wrappers, action mappings, and evaluation utilities.Environment interactions return observations, rewards, episode completion indicators, and additional information.
  • Data handling: Datasets can be downloaded, preprocessed, iterated, and encoded into spike trains for SNNs or other machine-learning systems.Supported preprocessing includes cropping, subsampling, and binarization; listed datasets include MNIST, CIFAR-10, CIFAR-100, and Spoken MNIST.
  • The Pipeline object: The Pipeline composes an environment, encoding function, network, and action mapping into a recurring interaction loop with optional visualization and observation control.Its step function coordinates action selection, network computation, environment interaction, and simulation updates.

4 Examples

BindsNET examples demonstrate compact scripts for unsupervised and supervised learning, reinforcement learning, and reservoir computing with spiking networks.

  • Overview: BindsNET examples emphasize concise scripts that create models, load datasets, define pipeline interactions, and run training loops without reimplementing underlying functionality.Users can modify model code when parameter changes are insufficient while preserving the surrounding language and environment.
  • Unsupervised learning: The unsupervised MNIST example uses DiehlAndCook2015, STDP, competitive inhibition, and one pass through 60K training examples for 350ms each.Network state variables are reset after each example, and learned filters represent prototypical digits.
  • Unsupervised learning: In unsupervised evaluation, the excitatory neuron with the filter most similar to a test image should fire first.The accompanying plots monitor the learned prototypical image filters and network activity.
  • Supervised learning: The supervised CIFAR-10 example divides 100 excitatory neurons into ten label groups and clamps a randomly selected group neuron to spike for each labeled input.Clamping drives the selected neuron's filter weights toward the current input example.
  • Supervised learning: The supervised 400-neuron example assigns twenty neurons to each image category and uses clamping with STDP to update synapse weights.The first groups represent plane and car categories, followed by the remaining categories.
  • Reinforcement learning: The Space Invaders example downsamples and binarizes observations, encodes them as Bernoulli spike vectors, and maps 60 output neurons into action populations.A multinomial feedback function samples actions from normalized activity, while reward-modulated STDP can update network parameters online.

5 Ongoing development

BindsNET is an early-stage open-source project with substantial room for improvement. Planned development includes broader model support, specialized ML/RL methods, tighter PyTorch integration, and improved performance.

  • Planned additions include neuron types, learning rules, datasets, and encoding functions prioritized by user needs.
  • The project aims to specialize machine learning and reinforcement learning algorithms for spiking networks, including network-level training methods.
  • Tighter PyTorch integration is identified as a development goal because more of PyTorch’s neural-network functionality may acquire spiking-network interpretations.
  • Future work also targets conversion of PyTorch or ONNX deep networks into near-equivalent spiking networks and optimization of library primitives.
  • Automatic smoothing of spiking neural networks could approximate spiking neurons as differentiable operations, enabling backpropagation and torch.autograd optimization.

6 Discussion

BindsNET is presented as an easy-to-use, flexible, and efficient Python framework for machine-learning and reinforcement-learning applications with spiking neural networks. Built around PyTorch and connected to Gym, it supports rapid prototyping while retaining access to neuron, spike, and synapse details.

  • 6 Discussion: BindsNET provides rapid, biologically inspired prototyping of spiking neural networks for machine-learning and reinforcement-learning applications.
  • 6 Discussion: The Python library uses PyTorch for neural-network functionality and supports multi-CPU or multi-GPU hardware configurations.
  • 6 Discussion: BindsNET supports building, training, and evaluating networks while emphasizing high-level functionality over detailed biological neuron complexity.
  • 6 Discussion: BindsNET is distinguished by its machine-learning and reinforcement-learning focus, whereas Nengo optionally uses TensorFlow while BindsNET uses PyTorch by default.
  • 6 Discussion: Researchers can still control membrane potentials, spikes, and synapse strengths, allowing detailed network manipulation alongside straightforward construction of large, flexible networks.
  • 6 Discussion: The authors characterize BindsNET as a simple, flexible option for quickly building SNN prototypes backed by an easy-to-use deep-learning library.
  • 6 Discussion: BindsNET encourages treating spiking networks as machine-learning models or reinforcement-learning agents, supporting integration of biological neural-network ideas with machine learning.
  • 6 Discussion: The framework provides a seamless interface to reinforcement-learning environments through mature open-source software support.
Loading 1806.01423v2…