A Spiking Model Exploration Tool

Developed for Physics 250 (taught by Jim Crutchfield)

Spiking models are a class of biological neural network simulation model which individuate each action potential or "spike" in the behavioral record. Recent and past work completed studying this type of network has repeatedly highlighted the fact that a sufficiently well-connected network, regardless of how it is constructed, exhibits a consistent and characteristic transition of state from a regime of absolute quiescence to one of maximum constant homogeneous activity (every node spiking at every time step) as the mean degree of the network is increased beyond the respective thresholds. In the intermediate states, between the two extremes of behavior, each network displays interesting information rich activity. The objective of this project is to develop a tool with which to study the dynamic spike patterns that emerge in this transition regime as a function of patterns of connectivity and other relevant static parameters.

Motivation

How is dynammical behavior determined by static structure? To ask a more specific question, how does connectivity influence causal flow in a deterministic system with a network architecture? Even more precisely: what infuence do topological properties and patterns in a brain-like network have on its patterns of activity? This line of questioning naturally motivates the computational study of neurobiological systems and their spiking properties.

What is a neural network?

At the simplest level of description, neural networks are representative networks in which nodes correspond to neurons and edges represent chemical or electrical synaptic connections between neurons. While engineers have historically employed neural nets for pattern recognition tasks such as handwriting and speech transcription, science has used a different variety of neural network as a tool with which to constructively investigate the functional properties of neurobiological systems.

Neurobiology

Neurobiology is an extremely extensive and complex subject and I cannot hope to do justice to that complexity in a small space, but here I have outlined pictorially the very basics of how neurons behave and communicate and have indicated a few parameters which are relevant to the specific model being employed by this software. For another quick, but slightly more detailed treatment see this page

Figure 1: (A) The cartoon to the left is a simplified and labeled depiction of two neurons with a unidirectional synaptic connection from the neuron on the left onto the neuron on the right. An action potential, or travelling electrical wave, propogates down the cell body of the sending neuron terminating at the synapse and causing the release of neurotransmitter into the synaptic cleft, pictured below (B). Neurotransmitter, in turn binds to the post-synaptic membrane of the receiving neuron and causes a flood of electrically charged particles to enter that cell. This serves to depolarize this portion of the cell. If enough charge accumulates, the receiving neuron will reach its threshold potential and an action potential will be triggered, restarting the cylce described here.

Leaky, Integrating, Ready to Spike

The Leaky Integrate and Fire Neuron was first proposed and explored by Stein in 1965. Each node in a spiking network represents a neuron of this variety with an associated electrical potential with respect to its environment on the other side of the cell membrane. At every time step in the simulation each node in the network integrates electrical input from all of its neighbors and external inputs (if present). Electrical current in the node "leaks" out of or into the node over time according to a specified decay constant towards a given resting potential. If the potential of a node reaches a specified threshold, the node "spikes" and delivers an stimuls of a specified voltage via its outgoing edges to its neighbors.

Figure 2: (A) The equations to the left detail the dynamics of the LIF neuron. In equation (1) we see the node membrane potential (V) relaxes towards a resting potential (Vrest) according to a decay constant. Added to the voltage when present is also an incomming external current I_e, which is broken down into its components in equation (3): an excitatory current I_exc, an inhibitory current I_inh and an applied current I_app (e.g. by voltage clamped electrode). For simplicity we only study the excitatory current here. When the membrane potential V reaches V_thresh, the node threshold, an action potential or "spike" is triggered and is transmitted to all receiving nodes via the axon and synaptic connection. The sending node instantaneously resets its membrane potential to V_reset.

(B) Below is an example of the spike train that is generated by a run of an LIF simulation.

About the software

A good deal of software which simulates spiking models has been previously written in languages such as Matlab. While terrific for scripting, plotting and analysis, Matlab struggles on non-plot visual presentation as well as interactivity. The objective of this software is to fill that need. That is, to create an environment which enables an investigator to modify parameters simply and intuitively in real time and gain a sense for the behavior of the system without needing to generate and analyze end-of-simulation reported statistics. Python provides an intuitive leightweight interface to the underlying algorithm and simulation procedure. Additionally, with the use of the PyGame set of extension modules, visual presentation as well as keyboard and mouse event handling is low overhead, reasonably efficient, and fun to develop and use.

System description

The state space of the dynamical system being studied is simply the vector of node membrane potentials in the network at a given time. Network dynamics are based on the Leaky Integrate and Fire model described above. In the software, dynamics in the system have been simplified as much as possible for both computational as well as conceptual efficiency. The most noteworthy design decision has been to include only excitatory synapses between nodes. While clearly this aspect of the simulation limits its applicable relevance to many specific biological networks, it also reduces the conceptual complexity while leaving intact the basic properties of the system. A second property to note is that default values for several static parameters have been set to the simplest values imaginable (e.g., 0 and 1 for resting potential and threshold respectively). Since the chosen range parameters is isomorphic to the choice of units by neurobiologists, there is no danger of introducing inaccuracies. The reduction of complexity here permits increased focus on topology while remaining neurobiologically relevant.

Visual Design

The graphical interface to the underlying simulation engine focuses on providing the user with information relevant to the state of the network over time in the least complex and most intuitive way possible while simultaneously providing extensive, immediate and integrated control over the static structure and dynamical state of the system.

Figure 3: A screenshot of the entire interface in action. Here the network is of size 30 and the History Panel, described below, is 60 timesteps long.

Visually and functionally, the interface can be parsed into two distinct pannels. Occupying the top right portion of the screen is a visual matrix representation of the connections in the network (known as the adjacency matrix). On the left side of the screen is a scrolling presentation of the node voltage history of the network over time. This pannel may be in one of three visual modes. Refer to Figure 3 below for more details. Note that in both pannels, blue/yellow rows and columns indicate multiples of ten and serve as visual guides with which to parse node correspondances and pattern lengths. These guides are colored blue where they would have otherwise been black. Similarly, yellow fills in for white.

Figure 4: Top left: 30 time steps of the History Pannel displaying node voltages over time. Previous timesteps descend down the screen and nodes along the horizontal correspond to the order of those in the Adjacency Pannel. Whiter colors indicate nodes which are more depolarized (closer to the threshold). Spiking nodes are black as they immediately reset upon spiking. Top right: Alternate binary view of node history displaying only spikes. In this view white squares correspond to nodes which are spiking and black to those which are not. Bottom left: A combined view. This is the same as the node view, except spiking nodes are colored red. Bottom right: The Adjacency Pannel. Along the horizontal are sending nodes and on the vertical are receiving nodes. White means the connection exists and black indicates absence. Thus if all of row 10 is white, it means the 10th node in the network receives from all other nodes.

Functional Design

Beyond displaying information, these pannels also serve as work surfaces. Specifically, edges may be created or destroyed in real time on the Adjacency Pannel and the network may be stimulated if it falls into quiesence on the History Pannel. Additionally, the simulation may be paused and restarted as desired. All these are done through mouse actions. Table 1 below summarizes all actions that may be taken with the mouse and keyboard.

Pannel Input Source Action Effect
History Mouse Left Click Switch visual mode (Node, Spike, Combined)
History Mouse Middle Click Pause/unpause simulation
History Mouse Right Click Stimulate network (with random stimulus)
Adjacency Mouse Any button click Add/remove edge
N/A Keyboard ESC Key Terminate simulation

Table 1:Mouse and keyboard actions in the GUI.

Download

Follow this link to the bottom of the page for download and installation instructions.

Findings and thoughts

Due to the exploratory nature of the software and because it is still in its infancy, the following observations while using this system are underdeveloped and any conclusions would be preliminary. Nonetheless, we can still make a few basic and yet interesting comments about what is seen when simiulating various configurations of spiking networks.

Perhaps most obvious and immediately apparent is that each network will move from a regime of absolute quiesence (no nodes spiking) to one of maximum constant homogeneous activity (all nodes spiking all the time) as one of several parametrs is increased monotonically. Except when other parameters are set to extreme values (e.g. probability of edge = 0), each of the following parameters invokes this phase transition behavior as it is modulated accordingly: mean degree (or, equivalently, probability of an edge between any two nodes), size of stimulus delivered in response to an action potential, threshold to fire, and to a lesser extent (i.e. tighter constraints are necessary on other parameters) the decay rate of node voltage.

Slightly more subtley, we can observe the fact that for each of the networks, regardless of configuration, the resultant behavior of the system is extremely sensitive to changes in these parameters. Not only do we enter or fall out of quiesent or seemingly epilleptic states quickly, but also one may notice significant qualitative changes in the type of patterns being displayed by the system for given parameter vectors. For instance, simply by changing the probability of edge presence by 1% in a 30 node network from 14% to 15% we see our spiking pattern go from complex and possibly even chaotic to very simple and repetitive. This observation is significantly repeatable according to a limited number of observations made thus far.

Figure 5: Here, the top row demonstrates 30 time steps of spike train / node voltage outputs of 30 node networks with the probability of edge presence parameter (pEdge) set to 14% and 15% on the left and right respectively. Corresponding adjacency matricies are given in the bottom row for reference. See above for an explanation of the coloration in these images.

In the below table I have characterized in a little more detail the nature of the transition regime for a small and medium sized network.

Size pEdge Cycle Behavior
4 .8 2 40% quiescent; 15% constant spiking; cycles occasionally as high as 4 or more
4 .9 1 75% constant spiking; 10% quiescent; 2 cycles sometimes
30 .14 4 to big very high variance in cycle length; some cycles of undetectable size; chaotic?
30 .15 2 to ~32 much more spiking; mostly smaller cycle sizes
30 .11 2 to big %10 quiescent; seemingly chaotic cycles like in the .14 case, but more repititious within the chaos; large time to reach cycles or quiescence

Table 2:Size is network size (i.e. number of nodes); pEdge is probability of the presence of an edge between two nodes; Cycle is the typical cycle length. Note, these are approximations based on my anecdotal evidence. Full quantitative statistical analysis will need to be automated and run over hundreds of trials.

To see how to modify and experiment with these (and other) parameters yourself, see the section below.

One important observation to note about these networks is that the behavior often cleary depends on the initial conditions. In many cases, some non-trivial states may lead to complete quiesence while others will lead to repeated spiking. Likewise, without modifying the adjacency matrix, some initial conditions will lead to complex possibly non-repeating patterns of spiking while others will result in simple two or four cycles. Thus in some sense, the same network can be observed to operate in multiple "modes."

This sensitive dependance on initial conditions for some parameter values is one indication that the networks may be demonstrating chaotic behavior.

Applicability

To briefly speculate on the applicability of this software and these models, we can look to the neuroscience literature as well as our own common sense. It is clear from the literature that the brain (human and otherwise) likely uses a form of sparse coding to represent salient recurring stimuli in the environment. In one way of viewing the system, sets of neurons form basis functions which can be combined in specific ways according to spiking behavior to caputre and reconstruct meaningful patterns in space, time and more complex derrivative dimensions. Figure 6 below gives an example of coding and reconstruction resembling sparsely-coded receptive fields in the primary visual cortex. Figure 7 demonstrates the use of sparse codes for motor skills.

Figure 6: An example image encoded and reconstructed with a set of basis functions. Notice how, among the entire set, most basis functions are not used in the encoding of a given patch. This is what is meant by "sparse". (image courtesy of Scholarpedia)

Figure 7: A demonstration of sparse motor codes used by songbirds while singing (source research by Hahnloser et al. in this Nature article).

Given this, one might imagine that a tool which gives an investigator the power to understand what types of spike patterns can be generated by certain neurobiological networks given a set of specified physical/structural constraints could be of service to those studying the ways in which sparse neural codes are employed by animals in the real world.

On the flip side of this, we can also look at the spikes being generated by these systems from a purely engineering standpoint. That is to say we might imagine how binary information can be represented and manipulated within machines using neural like architectures to carry out pattern-based tasks for a human. Such is the topic broadly of neural networks within the engineering/AI literature, as mentioned in the second section above.

Future Directions

The following is a short-list of the features that I believe are of highest priority to add to this software:

Clearly the software is not meant to be an end in itself. The most obvious research direction one can imagine employing this tool for is the study of maps between structure and function. Studying how patterns of firing in the nodes correspond to strucutural changes in edge connectivity is a first step. Here an examination of specific patterns or motifs should be complimented by a more systemic view of the network statistically. But even in statistics, subtle patterns can be found. For instance in addition to looking simply at how the mean degree of connectivity in a network effects the activity of that network, I would like to examine what happens when either the distribution of outbound or inbound edges of this directed net is altered.

The next level after this is investigating how these networks respond to "meaningful" input. Which networks can be made to take on what types of function properties?

Finally, a distant goal for the future is investigation of how these sorts of networks can be combined with one another, both to construct function compositions as well as to create perception-action feedback loops. This, of course, will require new paradigms of software interfaces to be studied in an analagous fashion to the simple networks studied here.

Downloading and running

Here are the steps you'll need to take to get this code on your computer and running.
  1. Install Python. Note that if you are on OSX you may already have Python on your machine. You can find recent (04/2009) instructions on downloading and installing Python on different architectures here. (scroll down to bottom!)
  2. UPDATE (6/2009): if Enthought distribution links (mentioned in the link above) are down, use these links: Python, PyGame (~8 MB), NumPy (~5 MB).
  3. Install PyGame and NumPy. Instructions are here.
  4. Make sure these two sets of extension modules are locatable by python. Runing the below code will complain if they aren't..
  5. UDPATE (6/2009): if you are on OSX, you might have trouble getting PyGame to work with either the default distribution or Enthought distribution. Follow the instructions here. Note: you will also still need NumPy.
  6. Download this zip archive of code (just 3 files).
  7. Run this code via Python in your command shell by changing directory to the SpikeExplore directory and running "python SpikeExplore.py".
Now that you have the code running with the default parameters, its easy to mess about with the simulation. This can be done either through the interactive mouse/keyboard commands described above or by changing parameters in the main file, SpikeExplore.py. Below I've reproduced the relevant lines that you may want to modify. In addition note that there are a couple of other sets of parameter values defined above this set in the file. Of course those variables are overwritten by those which immediately follow. That is, the last parameter values given in this file are the ones which are taken in the simulation.

Feedback

Please share your experiences with this software, ideas for further development, or anything else related to project you'd like to tell me or ask about. I am always looking to connect with new minds! All correspondance should be addressed to the email address at the top of this page.