Unsolved problems of neuroscience:

  • Awareness: What is the neuronal basis of subjective experience, wakefulness, alertness, arousal and attention? What is its function?
  • Perception: How does the brain transfer sensory information into coherent, private percepts? What are the rules by which perception is organized? What are the features/objects that constitute our perceptual experience of internal and external events? How are the senses integrated? Is face perception special (e.g. inert)? What is the relationship between subjective experience and the physical world?
  • Learning and Memory: Where do our memories get stored and how are they retrieved again? How can learning be improved? What is the difference between explicit and implicit memories? How plastic is the mature brain?
  • Development: How and why did the brain evolve (the way it did)? What are the molecular determinants of individual brain development?
  • Sleep: What is the function of sleep? Why do we dream? What are the underlying brain mechanisms? What is its relation to anesthesia?
  • Cognition and Decisions: How and where does the brain evaluate reward value and effort (cost) to modulate behavior? How does previous experience alter perception and behavior? What are the genetic and environmental contributions to brain function?
  • Language: How is it implemented neurally? What is the basis of semantic meaning?
  • Diseases: What are the neural bases (causes) of mental diseases like psychotic disorders (e.g. mania, schizophrenia), Parkinson's disease, Alzheimer's disease or addiction? Is it possible to recover loss of sensory or motor function?

"Ten Unsolved Questions of Neuroscience", an upcoming book by David Eagleman and Patricia Churchland, presents a similar list (I couldn't find much about this book on any book site):

  • How is information coded in neural activity?
  • How are memories stored and retrieved?
  • How do brains balance plasticity against retention?
  • What is the brain’s extensive baseline activity about?
  • How should we neurally characterize emotions?
  • What is intelligence?
  • How is time managed in nervous systems?
  • Why do brains sleep and dream?
  • How do the highly specialized subsystems of the brain coordinate with one another?
  • What is the neural substrate of consciousness?

I have my own list of questions to think about.

Questions to ponder after reading of COGNITION-AND-REALITY, THE-QUEST-FOR-CONSCIOUSNESS, and THE-FEELING-OF-WHAT-HAPPENS.

  • How does it happen that different people notice different aspects of the same situation?
  • Why are some potions of the retinal input treated as belonging to the same object, others as independent?
    • May it have something to do with results of co-occurence analysis?
  • Why do we often seem to perceive the meanings of events rather than their detectable surface features?
  • How are successive glances at the same scene "integrated"?
  • Why is perceiving almost always accurate, given inadequacies of the retinal image?
  • If percepts are constructed, why are they usually accurate?
  • What kind of cognitive structure does perception require?
  • What happens when we choose what to see and how do we learn to see better?
  • How are illusions and errors possible if perception is simply the pickup of information that is already available and specific?
  • How do we pickup unanticipated information?
  • What happens when a new object enters the field of view for the first time?
  • How is it decided whether to use an existing schema or to develop a new one (exploitation vs. exploration)?
  • How can anything at all be seen in a brief flash if perception is a temporally extended activity?
  • How is schema modified by new information? What elements of it are being modified? Anticipation? Motor program?
  • Is development of the schema from the general to the specific, from undifferentiated to precise or in the opposite direction?
  • Why do introspective reports suggest that the meaning is available first, and the stimulus details only later or not at all?
    • This is probably because introspection starts from the highest level schema of all active schemata
  • How does schema come to exist?
    • Some may be innate, but for those that are not, what's the mechanism? Co-occurrence?
    • The perceptual cycle must occur before it can develop
  • Can we perceive something not having an appropriate schema?
    • Maybe only at the lowest possible level, which will allow for bootstraping based on some mechanism, like co-occurrence.
  • Which schema develops earlier: the more complex "high-level" one, or the more simple "low-level" schema? (for example, shape vs. smile)
  • How do schemata get co-activated? When they are related? Include one another? Not related?
  • Does a schema for a concept (for example, "number") get easier and faster activated than a schema for an object that is part of that category (for example, number "five")? How do they influence each other?
  • Is it possible to deploy more than one schema at a time?
    • Yes, multiple schemata can be active, even though they have different level of activation (and influence of other schemata); based on that level of activation they compete with other schemata for resources (gaze, effectors, and so on)
  • What does presence of expected/unexpected information in the environment does to the schema? In terms of activation? In terms of its modification?
  • Why is it difficult to pick up information from two different messages/streams at the same time?
  • Is it possible to attend to two things at once?
  • What are the limits of automatic mental activity?
  • Why/how does perception depend on a skill? What skill is that?
    • Motor program that supports co-activation of other programs...
  • Are schemata being influenced (activated/modified) by unattended information?
  • Is there a single mechanism responsible for our cognitive limitations? What are the limitations? (THE-MAGICAL-NUMBER-SEVEN)
  • What types of conflicts may arise from activation of two schemata? How do those conflicts get resolved/arbitrated?
  • Is there some impediment to the parallel development of independent, but similar schemata? Does existing schema "canalize" incoming information and experience effectively preventing the second (similar) schema to be formed?
  • Is consciousness an aspect of activity or an independently definable mechanism?
  • Is it possible to think without being conscious?
  • How does the subject know whether the present content of his consciousness originated with an external stimulus?
  • Does imagery appear when pickup of information is delayed or interrupted?
  • If images are anticipations rather than pictures, what's going on when we describe them?
  • How can we imagine things we don't expect, for example, things we know cannot happen?
    • Anticipations concern things that only might come to pass rather than those things whose existence is already established
  • How does detachment of images from the immediate context come about?
    • This detachment occurs inevitably in at least one situation with which we are all familiar: locomotion
    • Any delay between the anticipation and the pickup creates a state of unfulfilled perceptual readiness, and the inner aspect of that active shema is a mental image
  • How are cognitive maps (and other types of schemata) acquired?
  • What sorts of information do they incorporate at various stages in their development?
  • How are they altered by experience?
  • Under what conditions are they forgotten?
  • Where many schemata exist, what distinguishes the right one?
  • How schemata stored in memory? What represents long-term memory?
    • Repeated representation of the same material constitute a regularity to be detected
    • Use of schemata accounts for remembering
    • Forgetting occurs whenever the present inputis not specific enough to select a schema unequivocally
  • What's the difference between perception and imagery?
    • Perception is a cyclic activity that includes an anticipatory phase; imagery is anticipation occuring alone
  • What schemata are we born with? Schemata sensitive to expressions of emotion? Intentions?
  • How words come to refer to objects?
    • Is it required to be "engaged in two perceptual cycles at once"? (COGNITION-AND-REALITY, p.164)
    • Are those words embedded in the schema or related to/associated with it?
  • What is the principal function of grammatical structure of a sentence?
    • Is it to help the listener to develop proper anticipations that may span many seconds? (Ibid, p.167)
  • How does one describe what one sees?
  • Why do we feel that we know what we're going to say, but only in some general way?
  • How does anticipations get detached from the stimulus information that generated them to become things we imagine?
  • Who has more freedom in their actions: adult or infant?
  • How do we perceive emotion of feeling in others?
    • Perceiver needs to have schemata to pick this information up
    • How much do these schemata depend on social experience?
  • Why do we (sometimes) hear multiple voices arguing?
  • How is anticipated image formed? What specifically is being anticipated (out of many possibilities)?
  • How is movie-in-the-brain generated? How does the brain generate the sense of an owner and observer for that movie?
  • What's the relationship between consciousness and emotion? (EMOTION-AND-CONSCIOUSNESS)
  • Are there any non-conscious feelings? Are we conscious of all our emotions and feelings?
  • What distinguishes emotion from feeling?
    • Emotions are external indication of feelings
    • Emotions are experienced as feelings
    • Emotions play signalling role; feelings facilitate learning and motivate behavior (on a larger scale) or produce a specific behavior (on a smaller scale) like freezing
      • "[Pleasure] is related to the clever anticipation of what can be done not to have a problem." "[Nature] seduces us into good behavior." (THE-FEELING-OF-WHAT-HAPPENS, p.78)
    • Expression of emotion drives feeling, which in turn supports expression of emotion; chicken and egg
  • Can we control/supporess emotions/feelings?
  • Why do we need to be conscious to have feelings or express emotions?
  • What's the difference between sensing pain and knowning you have pain?
  • What distinguishes zombies from normal (non-zombie) organisms? Automatism? Lack of intentions? Lack of continuity of purpose? Always-on learning (zombie learning)?
  • What are the properties of consciousness?
    • William James (cf. THE-FEELING-OF-WHAT-HAPPENS, p.126): it's personal, selective, continuous, and pertains to objects rather than itself
  • Why is there significant delay (up to 500ms; Libet's experiments) between registering of a sensation and conscious experience of it?
  • How does always changing mind preserve its identity? What is is that provides mind with this core that is always the same? Is "self" a concept as any other concept and is built based on interactions with other individuals (culture and meme links)?

Modeling tools and simulators

What would I want from a framework or a simulator?

  1. It needs to implement biologically plausible models
  2. It needs to be fast enough to model tens of thousands on neurons with 1ms step (#1 and #2 usually don't come together)
  3. It needs to provide an interface for developing simulations and monitoring their execution with real-time visualization (ideally as good as Neural Viewer does) and network activity diagrams
  4. It needs to be easily configurable. All network parameters and their visualization should be compactly specified
  5. It should support various sensory and motor systems
  6. It should provide a comprehensive set of networks to play with

The functioning of an organism in a complex and unpredictable environment is supported by two complimentary processing systems, cognition and emotion. While the cognitive system is responsible for interpreting and making sense of the world, the emotion system is responsible for evaluating and judging events to assess their overall value with respect to the organism (ROBOT-EMOTION; p.2). Paul Ekman in Basic Emotions (HANDBOOK-OF-COGNITION-AND-EMOTION; ch.3) offers a slightly different perspective: "...the primary function of emotion is to mobilize the organism to deal quickly with important interpersonal encounters, prepared to do so by what types of activity have been adaptive in the past."

More specifically, functions of emotions in animals (including humans) can be summarized as follows (based on NEURAL-NETWORKS-AND-BRAIN-FUNCTION; pp.138-40):

  1. Elicitation of automatic responses. Emotion may elicit an autonomic (for example, a change in a heart rate) or endocrine (for example, the release of adrenaline) response that prepares the body for action.
  2. Flexibility of reinforcement. Emotional states allow a simple interface between sensory inputs and motor outputs, because only the valence of of the stimulus to which attention is being paid needs to be passed to the motor system, rather than a full representation of the sensory world. In addition to that, when a stimulus elicits an emotional state, we can flexibly choose any appropriate response, which is more flexible than simply learning a fixed behavioural response to a stimulus.
  3. Motivation. For example, fear learned by stimulus-reinforcement association formation provides the motivation for actions performed to avoid noxious stimuli.
  4. Communication. Animals can communicate their emotional state to others. What is the role of mirror neurons?
  5. Storage of memories. Emotion may facilitate the storage of memories. This may be advantageous in that storing many details of the prevailing situation when a strong reinforcer is delivered may be useful in generating apropriate behavior in similar situations in the future. This may be facilitated in several ways: a) by bringing more attention to important situations the animal may be storing more information, b) by guiding attention toward what's important and away from distractions one may be storing more relevant information and c) by involving emotions stronger associations can be built.
  6. Evaluation of memories. The current mood state can affect the cognitive evaluation of events or memories.
  7. Memory recall: Emotion may trigger the recall of memories stored in neoroctical representations. Amygdala backprojections to the cortex could perform this for emotion in a way analogous to that in which the hippocampus could implement the retrieval of recent memories in the neocortex.
  8. Better performance. The slowing of cognitive processes caused by negative emotions may enable more careful and deliberate scrutiny of self and circumstances, allowing the individual to gain a new perspective to help improve performance in the future. Negative effect allows us to think in a highly focused way while positive effect allows us to think more creatively and to make broader associations.

Paul Ekman in Basic Emotions identifies 15 basic emotions: amusement, anger, contempt, contentment, disgust, embarrassment, excitement, fear, guilt, pride in achievement, relief, sadness/distress, satisfaction, sensory pleasure, and shame. He also discusses enjoyment and surprise, but doesn't include those as basic emotions as they don't "subserve patterns of motor behavior which were adaptive for each of these emotions, preparing the organism for quite different actions." Also, interest "may be better regarded as a cognitive state rather than an emotion..." This list of emotions also doesn't include love, hate, grief, and jealousy as these are "emotional plots, more specific, more enduring than the basic emotions, specific contexts in which a number but not all of the basic emotions can be expected to occur." Ekman also defines moods -- which have different causes and last much longer, and are highly saturated with emotions -- and personaly traits, such as hostility.

Cynthia Breazel and Rodney Brooks in Robot Emotion: A Functional Perspective provide descriptions for a number of basic emotions that were implemented in the robot Kismet and gives details of that implementation (pp.17-20)

  1. Anger. Anger serves to mobilize and sustain energy and vigorous activity at high levels. If it often elicited when progress toward a goal is hindered or blocked. This mobilizes an organism to try alternative strategies.
  2. Disgust. Disgust is manifested as a distancing from some object, event, or situation, and can be characterized as a rejection of an unwanted stimulus.
  3. Fear. The function of fear is to motivate avoidance of escape from a dangerous situation.
  4. Joy. The emotion of joy is believed to heighten openness to experience. It often arises upon the success of achieving a goal or in the pleasure of mastery, exhibited even by very young children. The expression of joy operates as a universally recognizable signal of readiness for friendly interaction.
  5. Sorrow. Experiencing of sadness is causing to slow the cognitive and motor systems, which enables one to reflect upon a disappointing performace to gain a new perspective that will help improve future performance. The expression of sorrow communicates to others that one is in trouble and increases likelyhood that the others will feel sympathy and lend assistance.
  6. Interest. Interest motivates exploration, learning, and creativity. It mobilizes the creature for engagement and interaction. It serves as a mechanism of selective attention that keeps the creature focused on a particular object, person, or situation, and away from other distractions that impinge upon its senses.
  7. Boredom. Boredom is an emotion that arises when the organism is not stimulated for a while. Hofstadter has an interesting note about boredom in GODEL-ESCHER-BACH (p.621): "you get bored with something not when you have exhausted its repertoire of behavior, but when you have mapped out the limits of the space that contains its behavior."

update 2006/03/02: Just noticed that Chris Chatham also posted some interesting (as always) information on this subject on his weblog earlier this month: Emotional Robotics and Simulating Emotion.

update 2006/03/21: This article by Edmund Rolls has an interesting diagram that put emotions on a scale from rage to relief and from terror to ecstasy.

I was re-reading my reply to Chris Chatman's post about biologically accurate modeling and realized that I was focusing on the wrong aspect of his message. Chris is right. There are so many different features that may need to be modeled to achive the result we want; yet every new feature complicates the model, makes it run slower, and makes it more difficult to analyze the behavior of the model and tweak it further. So, what can we ignore?

  1. Biologically plausible model(s) for different types of neurons (like the model proposed by Eugene Izhikevich)
    1. Number of neuron types to model; Can we simply use two types: regular spiking (RS) for all excitatory and fast spiking (FS) for all inhibitory neurons. Probably not.
    2. Model time step; Is 1ms enough? Some of the types modeled with Izhikevich model require 0.1ms time step.
  2. Axonal delays
  3. Synaptic plasticity and restructuring
  4. Synaptic connectivity
  5. Synaptic noise
  6. Synaptic currents
  7. Brain modularity
  8. Size of the model; Number of neurons? Number of connections? Ratio of excitatory and inhibitory neurons? Different in different modules?
  9. Sensory input / motor output; How may different types of sensors? How sensitive/complex? Attention mechanism?
  10. Developmental aspects
  11. Emotions
  12. Various types of neurotransmitters and neuromodulators; neuron geometry and localized effects of some neurotransmitters/modulators
  13. Real-time/on-line vs. static/off-line
  14. Sleep
  15. Dendritic geometry (including dendrite-to-dendrite and axon-to-axon connections)
  16. Glial and other supporting cells
  17. Wired-in vs. emergent behavior
  18. Reward/punishment

Mind Hacks posted a link to an interesting paper (GRAY-AND-WHITE-MATTER-IN-THE-BRAIN) that aims to answer a question "What's the reason for brain segregation into white and gray matter?". According to the authors of the paper:

... the optimal design [of the brain] depends on the number of neurons, interneuronal connectivity, and axon diameter. In particular, the requirement to connect neurons with many fast axons drives the segregation of the brain into white and gray matter.

One of the authors, Dmitri Chklovskii, co-authored several other papers on the same subject (Network Motifs: Simple Building Blocks of Complex Networks and Geometry and Structural Plasticity of Synaptic Connectivity). The second paper has a brief summary of three categories of synaptic plasticity and different timeframes associated with those categories (the paper itself focuses on the third category and its implications for the structure of the brain):

  • Changes in pre-existing synapses without alterations of interneuronal connectivity that can be realized within a minute
  • Formation of new spines that takes tens of minutes, and
  • Major remodeling of dendritic and axonal branches, usually occuring on the time scale of days.

Dmitri Chklovskii's page also has information on how optimization theory can be applied to brain design with wiring economy principle being one example of a successful optimization hypothesis.

There is also a paper that presents the map of the whole cortical circuit; the connectivity model from this paper was used in the simulation of a model with the number of neurons there is in a human brain.

Chris Chatman on his weblog portraits a gloomy picture awaiting biologically accurate neural modeling:

By most estimates, there are 100 billion neurons in the brain. Some neurons are known to have more than 1,000 dendrites, and up to about 1,000 different branchings of their axons. There are some 50 known neurotransmitters, and who knows how many other neuromodulators may exist (hormones, neural growth factors, neurosteroids). There are also many different receptor types for each of the neurotransmitters. A conservative estimate of the number of interactions you'd have to model to be biologically accurate is somewhere around 225,000,000,000,000,000 (225 million billion).

While this is definitely true, I'm almost equally split between two positions. On one side, the situation may be even more hopeless if you agree with Eugene Izhikevich's polychronization theory:

...spiking networks with delays have more groups than neurons. Thus, the system has potentially enormous memory capacity and will never run out of groups, which could explain how networks of mere 1011 neurons (the size of the human neocortex) could have such a diversity of behavior. (p.270)

At the same time, I would not try to set a goal of building/modeling/simulating something that can exhibit general purpose intelligence; after all, you don't expect to have a conversation about weather with one of the participants of the Grand Challenge. I'm more interested in building brains that demonstrate special purpose intelligence. After all, there are "only" 20000 nerve cells in Aplysia, which is a much more manageable size to model.

I'm keenly interested in modeling the smallest and simplest brain that shows signs of intelligence (defined in Cotterill's terms).

In addition to all visual features I want, I also want the framework/simulator to be easily configurable and scriptable, and what language provides better parsing and scripting capabilities than Perl? (or Python, or Ruby, but my experience with those is very limited...)

It's (non)surprisingly easy to call perl from C as the following code shows:

#ifdef __cplusplus
  extern "C" {
#   include <EXTERN.h>
#   include <perl.h>
    static PerlInterpreter *my_perl;
  }
#endif

int main(int argc, char **argv, char **env) {

  my_perl = perl_alloc();
  perl_construct(my_perl);

  perl_parse(my_perl, NULL, argc, argv, env);
  perl_run(my_perl);

  perl_destruct(my_perl);
  perl_free(my_perl);

  return 0;
}

This code can be compiled with something like this:

g++ -c interp.c -o interp.o `perl -MExtUtils::Embed -e ccopts`
g++ interp.o -o interp `perl -MExtUtils::Embed -e ldopts`

and then interp -v should give you the same output as perl -v.

While it may be easy to compile and run this simple program, it's still a challenge to pass complex data structures between C and Perl as you need to know all those *_sv, *_pv, *_av and stack manipulation calls. Fortunately for me I own a copy of Extending and Embedding Perl. There are even libraries like PerlStream that will hide all that complexity from you.

Another problem is that it means having additional libraries and module files (if you happen to use Perl modules) in your distribution. On Windows this can be solved by using Thinstall, PEBundle, or one of many other exe packers that compress executable and dll files into a single file.

Out of several options I looked at for visualizing results of a simulation OpenGL/GLUT combination looks the most promising. In additional to being able to see the simulation in real-time, I'd also like to have the following:

  • Network activity; firings per second; separate for inh and exc neurons? separate for different types of neurons?
  • Neuron connections and delays; would show incoming/outgoing connections and their delays; spike propagation
  • Neuron activity; would include the input current (I), the recovery current (u), and the membrane potential (v); would generate something similar to this digram only in real-time
  • Synaptic weights; would show current and previous value of all synaptic connections (incoming, outgoing, or both?) of a neuron
  • Neuron properties; to view/edit properties of individual neurons
  • Neural complexes; to research polychronous groups

Neural Viewer already provides most of what I need (it also has help, comments, console, and network selection screens), but, unfortunately, the source code for it is not available.

To implement this in OpenGL/GLUT in addition to some basic functions I would need to at least know the following:

After completing all the prep work I was ready to make the jump and to modify the code to use the new model instead of the earlier proposed one that SPNet++ is based on.

The core of the change was to replace this code:

v' = 0.04 * v * v + 5 * v + 140 - u + I
u' = a * (b * v - u)

with after spike resetting:

if v >= 30mV then v = c; u = u + d

where variable v represents the membrane potential of the neuron, u represents a membrane recovery variable, I is the input current, and a, b, c, and d are model parameters.

The code above was to be replaced with this (very similar) code:

v' = (k * (v - vr) * (v - vt) - u + I) / C
u' = a * (b * (v - vr) - u)

with after spike resetting:

if v >= vpeak then v = c; u = u + d

where v is the membrane potential, u is the recovery current, C is the membrane capacitance, vr is the resting membrane potential, vt is the instantaneous threshold potential, vpeak is the spike cut-off value, a is the recovery time constant, c is the voltage reset value, and d is the total amount of outward minus inward currents activated during the spike and affecting the after-spike behavior. Though it looks like the model has ten parameters, it is equivalent to the previous version of this model shown above and hence it has only four independent parameters (DYNAMICAL-SYSTEMS-IN-NEUROSCIENCE, pp.161-3, 296)

While this change was easy, there were three other parameters, for which I didn't know what values to use: the input current and the default synaptic strength for excitatory and inhibitory neurons. After playing with various values for these parameters I finished with this result, which I'm not satisfied with as it only remotely resembles the diagram generated by the old code (also generated for the network of 1000 randomly connected neurons). Not sure which one is correct, though.

The first modification to make to implement the new model using existing SPNet++ code was to enable variable timestep, as the existing code only supported one time step (1ms) and the new model required 0.1ms time step for fast spiking (FS) neurons.

After I finished making changes and run the code for the first time the firing rate (number of spikes per neuron per second) dropped from ~7 to almost zero. After spending few minutes looking at the data I realized that by changing the time step from 1ms to 0.1ms I effectively reduced the time that input current influences the neuron and it was not enough to excite it. After a brief search on the Internet I found a paper that describes duration of spikes for excitatory and inhibitory neurons. Based on the data provided in the paper I made the input current to decay; and after applying this logic to synaptic and random thalamic input I almost got the numbers I expected.

Almost, but not quite. I ended up changing the logic that handles synaptic delays as it expected to work with delays expressed in ms and I needed delays to vary depending on the time step.

I also modified the generator of random integers from (rand()%(int)(max1)) to (int(((double)rand())/((double)(RAND_MAX)+1)*(max1))). According to the author of this page this can make a difference, depending on the type of the random number generator used.

Here is the current version of the source code and here is the diagram of the spikes it produces. It shows all spikes during the 50th second of the simulation for 1000 neurons (the top part of the picture shows inhibitory neurons):

Reviewing the code of the SPNet++ I realized that the implemented synaptic plasticity mechanism in the simulation is much simpler than I expected. It turned our that the code implements the nearest-neighbor spike model described in RELATING-STDP-TO-BCM article by Eugene M. Izhikevich and Niraj S. Desai. According to the authors of the article it may be sufficient to only consider two postsynaptic spikes -- the one that occurs before and the one that occurs after the presynaptic firing -- while determining whether a synapse should be potentiated or depressed based on recent spike activity. In addition to attempting to unify different forms of plasticity -- spike-timing-dependent plasticity (STDP) and a standard long-term potentiation and depression (LTP/LTD) -- into a single framework, this approach appears to be very computationally efficient.

update 2006/01/14: STDP-BASED-ON-LOCAL-INFORMATION paper presents an alternative rule, which is also described as computationally efficient, yet simple and reliable. This paper also provides five types of gating functions: no gating, presynaptic, postsynaptic, dual OR and dual AND gating.

There is also more information on different types of synaptic plasticity in the post on synaptic connectivity.

After reaching a dead end with neural modeling using Perl and PDL I decided to take another look at Eugene Izhikevich's implementation of a neural simulator described in one of his articles. It turned our that a group in Israel already extended his implementation and added a MATLAB interface as well as support for different kinds of input channels and recorders. Still, the current code a) implements the older model, b) has all neuron parameters hardcoded, and c) doesn't provide real-time Neural-Viewer-like visualization. Let's see how much time fixing a) and b) will take...

During the last several weeks I've been working on implementing a simulation of a simple network based on the simple model of spiking neurons. As I am very familiar with Perl I decided to try to use Perl and the Perl Data Language (PDL) module, which provides capabilities similar to those of MATLAB and IDL. The PDL module supports efficient and compact storage of multidimensional arrays and provides the fundamental operation of numerical linear algebra.

Much to my disappointment, the code that I wrote runs too slow. I'm sure that there are many ways to improve my PDL code (it's my first PDL script), which may significantly increase its performance, but still, it took more than 4 minutes (265 seconds) to simulate 400ms of model time for the network of randomly connected 1000 neurons with 28 spikes per neuron per second. It took 18 seconds to simulate 100ms of model time for 1000 neurons and 189 seconds to simulate 1s of model time for 100 neurons, which means that the implementation doesn't scale well when the number of neurons or the simulation time increases.

To compare these numbers with the performance of the simulation written in C or C++ I downloaded the source code of the program written by Eugene Izhikevich for his model and available on his website. His program compiled under CygWin calculated 1s of model time in less than a second of real time for a network with 1000 neurons with ~10 spikes per neuron per second. Even though two programs implement slightly different models (the C++ code implements the model with 4 parameters covered here and my code implements the model with 7 parameters covered here) and have different number of connections per neuron (100 for Eugene's implementation and 1000 in my implementation), the C code also implements axonal conduction delays and spike-timing-dependent plasticity (STDP), which are not included in my implementation.

This difference of two orders of magnitude means that I'll stay with C++ for now. And, BTW, here is the perl script I was running.

In addition to all good things about the Simple Model of Spiking Neurons, there are few weaknesses that I observed while working on implementation of the model:

  • The model appears to be sensitive to large currents (for some types of neurons); there is probably something wrong with my implementation of the model
  • The model requires very small time step for some types of neurons (0.05ms for low threshold spiking (LTS) and fast spiking (FS) neurons); there is probably not much that can be done about this, but it definitely creates challenges with simulating those types of neurons as it requires to implement various time steps for different types of neurons to speed up the simulation. What's interesting, the previous version of the model had the same time step (0.5ms) for all types of neurons.

update 2005/12/21: According to the author of the model (private email):

There is indeed a problem with stability when the injected current, I, into a thalamic cell is too strong. You may interpret this as an artifact of the model, or as the sign that such a strong current can kill the cell.

update 2005/12/22: Again, from the author of the model on the same problem (private email):

What happens is that the peak of the spike and the voltage reset variables meet, periodic spiking disappears, and the voltage variable drops. This behavior resembles the "excitation block" behavior of many neurons (no spiking when the input current is too strong), though the mechanism may be different.

update 2005/12/22: And here is the recomendation on how to fix this:

...use the following formula for the after-spike reseting of u: u <- min(u+50,530). This way, u never goes above 530, and the the spike cutoff and afterspike reset values never intersect.

Here is the result and the modified script.

After finishing playing with excitatory neurons I turned to inhibitory neurons and after several unsuccessful attempts realized that I'll probably spend more time getting them right than I was planning on. Even though I tried many different sets of parameters (based on parameters documented in Izhikevich's book Dynamical Systems in Neuroscience: The Geometry of Excitability and Bursting) I just couldn't get it to work properly. I sent an email to the author, who kindly provided his MATLAB scripts that he used to model fast spiking (FS), late spiking (LS), and thalamic interneurons (TI) neurons. The reason for most of my problems was quite simple: I was using the wrong time step. For example, this is how the diagram looks for similation of one fast spiking (FS) neuron with 0.5ms time step:

and here is how it looks with the correct time step of 0.05ms:

Even though this fixed most of the problems there were still few I didn't know what to do about. For example, the model for thalamic interneurons was unstable with large currents (even with the current just slightly larger than showed in the book: 258pA vs. 255pA):

I also ended up modifying parameters for the low threshold spiking (LTS) neurons; I took c and d parameters from the model for fast spiking neurons (based on the older version of the model). Here is how the result looks like:

And here is the script that I used to generate all these diagrams.

As I wrote in my last post on neural modeling there are several things that I like about the model of spiking neurons proposed by Eugene Izhikevich (see also WHICH-MODEL-TO-USE for comprehensive comparison with other available models):

  1. It's fast: only 13 FLOPS versus 5 FLOPS for Integrate-and-Fire and 1200 FLOPS for the Hodgkin-Huxley model
  2. It's biologically plausible: it exhibits the same neuro-computational properties as the most complex, Hodgkin-Huxley model
  3. It allows to model various types of neurons by changing four (in the latest revision seven) parameters
  4. It has no fixed threshold or absolute refractory period: these are properties rather than parameters of the model and depend on the type of a neuron. Based on the history of the membrane potential prior to the spike, the threshold potential can be as low as -55 mV or as high as -40 mV.

Izhikevich proposes classification of all neuron types as resonator/integrator (based on presence of subthreshold oscillations) and as being bistable/monostable (based on co-existance of resting and spiking states), which, in combination, make four groups. By using this classification he is able to derive several neuro-computational properties of those types of neurons:

  • Inhibition impedes spiking in integrators, but can promote it in resonators (this came as news to me; I was under the impression that inhibition always inhibit spiking)
  • Integrators have all-or-none spikes while resonators may not
  • Integrators have well-defined threshold while resonators may not
  • Integrators integrate, resonators resonate. This means integrators prefer high-frequency inputs; the higher the frequency, the sooner they fire. By contrast, the response of the resonator neuron depends on the frequency content of the input

Most cortical pyramidal neurons (including regular spiking (RS), and chattering (CH) neurons shown in the previous post) are integrators. Most cortical inhibitory neurons are resonators. According to the author of the model, a good neuronal model must reproduce not only electrophysiology but also bifurcaiton dynamics of neurons.

It seems logical to start building a neural network framework or a simulator with a neuronal model. Neuronal models and their implementations range from simple (like the model that is implemented in Neural Viewer) to very complex (like the Hodgkin-Huxley model). While there are many models to use (Which model to use for cortical spiking neurons? article provides a good coverage of the existing models) I like the model proposed by Eugene Izhikevich in Simple model of Spiking Neurons as it is computationally efficient and still biologically plausible.

Eugene's website provides MATLAB scripts to play with the models, but since I didn't have access to a MATLAB instance I decided to reproduce the same set of diagrams using Perl. After a couple of weeks of experiments and several emails to the author I was able to model various types of neurons according to the parameters described in Dynamical Systems in Neuroscience: The Geometry of Excitability and Bursting. Here is how the results look for the regular spiking (RS) neuron:

And here are the results for the chattering (CH) neuron:

30 Nov 2005 at 22:17 in modeling | Digg | Reddit | Google | Amazon | Wikipedia

After attending our local SeattleAI meeting and discussing neural network frameworks I decided to put together my notes on this subject.

What would one need to know to do neural modeling?

This paper (Introduction to Computational Neural Modeling for Computer Scientists and Mathematicians) provides a list of principles that govern well-practiced neural modeling:

  • Knowledge of neuroscience principles
  • Knowledge of computational time and space complexities
  • Awareness of computational resources
  • Well-researched neurological parameters
  • Well-planned and implemented model design
  • Documentation discipline (both parameter sources and coding)
  • Knowledge of statistical analysis techniques
  • Patience

Neuron

See Neural Modeling: Neuron

Synapse

  • See Neural Modeling: Synaptic Plasticity
  • See Neural Modeling: Synaptic Connectivity
  • Post synaptic potential (PSP) models
  • Neurotransmitters (only four most significant types out of hundreds discovered):
    • AMPA -- fast excitatory
    • NMDA -- slow excitatory
    • GABAA -- fast inhibitory
    • GABAB -- slow inhibitory
  • Transmission delays
  • Plasticity: presynaptic/postsynaptic
  • Operations: AND, OR, XOR, NOT, SUM, MUL, MAX

Learning

  • Learning algorithms:
    • Synaptic weight changes:
      • Hebb's rule: if S sends a pulse at time t and R fires at time t+1, then that synapse becomes more effective at firing R in the future
      • Milner's modification: if S sends a pulse at time t and R does not fire at time t+1, then that synapse becomes less effective in firing R in the future
    • Connection changes (more/less connections with a particular neuron)
    • Neuron changes (birth/death)
  • Learning related problems:
    • Under-/over-learning; under-/over-fitting
    • Catastrophic interference
  • Sensitization/habituation
  • Types of learning: autonomous, continuous, on-line, supervised/unsupervised

Initial configuration

Architecture

Simulation

Overall models

Modeling tools and simulators

From Eugene Izhikevich's website:

On October 27, 2005 I finished simulation of a model that has the size of the human brain. The model has 100,000,000,000 neurons (hundred billion or 1011) and almost 1,000,000,000,000,000 (one quadrillion or 1015) synapses. It represents 300×300 mm2 of mammalian thalamo-cortical surface, specific, non-specific, and reticular thalamic nuclei, and spiking neurons with firing properties corresponding to those recorded in the mammalian brain. The model exhibited alpha and gamma rhythms, moving clusters of neurons in up- and down-states, and other interesting phenomena.
One second of simulation took 50 days on a beowulf cluster of 27 processors (3GHz each). Why did I do that?

This sounds like a great achievement, but I've always been interested in modeling a smallest, simplest, and slowest brain that exhibits intelligence. How many neurons and connections would it have? What modules and components are essential and what are not? How much of intelligence would be lost because of its size and simplicity? How fast can it be trained to do something useful? What properties would need to be wired in and what properties would emerge?