School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 306,959 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,919 people online right now. Registration is fast and FREE... Join Now!




A simple neuron model - The integrate and fire neuron

 
Reply to this topicStart new topic

> A simple neuron model - The integrate and fire neuron, On the way to Neural Networks

muballitmitte
Group Icon



post 20 Nov, 2008 - 11:22 PM
Post #1




A simple neuron model - The integrate and fire neuron


1.Motivation
I`ve seen somewhere on DIC that someone suggested a tutorial on Artificial Neural Networks(ANN). Whilst that seems to be a bit far-fetched due to its complexity(there are books that barely scratch the surface) I believe that a presentation of a simple neuron model would be a great starting point to anyone who is interested in neural networks. Once the dynamics of such a neuron are understood it will be rather easy for someone to build a network consisting of such neurons.

2.Introduction
The brain, consisting of large number of interconnected cells, is the most important part of the neural system. We try to model it thus creating an arti?cial system that can be characterized as intelligent. In order to be able to create such a model one must first understand the basic elements of biological nervous systems. A nervous cell will consist of three distinct parts: the dendrites, the soma, and the axon. The soma is the central processing part of the cell, whilst the dendrites and the axon just deliver information. Roughly speaking the dendrites will play the role of input devices which gather signals from other neurons and send them to the soma, and the axon takes the signal generated by the soma to the connected neurons. We will refer to the junction between two neurons as the synapse.

Neurons communicate by sending to one another short signals spikes, or action potentials. A chain of such action potential is called a spike train. We de?ne the membrane potential as the difference between the potential of the interior of the cell and the potential of the exterior. This potential is affected by the input from the presynaptic neurons. The membrane potential rises if input is received at an excitatory synapse, and decreases
when input is received at an inhibitory synapse. If the membrane potential reaches a threshold the neuron ?res a pulse along its axon.

The biological neuron is a complex dynamical system and that is very to hard imitate accurately. Even though the neuron is not yet fully understood its basic mode of operation has been translated into a mathematical model for computer use. Thus more than one type of models exist; some models will try to imitate the biological neuron in great detail taking into consideration all the physical and chemical aspects. This models usually show what computational power can be achieved with a single neuron. Others will model at higher level of abstraction an thus allowing networks to be build on top of such neurons and these networks can be later made to learn something.


3.The model
I will present one of the most simple neuron models, the integrate and ?re(IAF) neuron. Let us consider an input current I=I(t) (where t is the time) which depolarizes the neuron membrane thus causing a growth in its potential. When the potential v reaches a certain preset threshold ?th the neuron discharges -i.e. ?res a pulse along its axon, and the membrane potential is set to its reset value vr.

The membrane potential is given by the following equation

Attached Image

where v = v(t), I = I(t), R is the resistance, C the capacitance in the model, v0 the resting value of the potential, and tm = RC is membrane time constant.
By solving this differential equation we will get the form of the membrane potential

Attached Image

where t with hat is the last fire of the neuron. I have not shown here the calculations. Anyone interested please contact me.

4.Implementation
Here we will do a simple simulation with such a neuron. We will take an integrate and fire neuron which has one presynaptic neuron, simulate its behavior in a discretized time and plot its membrane potential. The presynaptic neuron will send spikes along the synapse between the two neurons at given times. In this simulation we will use exponential current with a given decay. Thus I=I(t) will have the following form

Attached Image

where q is the total charge delivered by the spike, ts is the time constant of the current’s decay and tj contains the fire times of the presynaptic neuron j( i.e.that is connected to the our simulated neuron).
With this known and with the solved differential equation we can implement the neuron. Basically we will have a neuron that receives inputs periodically and we observe the fluctuation of its potential. If the potential reaches a threshold the neuron will fire a spike represented in the simulation as an vertical line. For the sake of simplicity we will assume the the synapse on which the spike arrive is excitatory.

The output

Attached Image

The implementation is provided in MATLAB.
CODE

t = (0:100); %duration of simulation 100 time steps

%Neuron Parameters
%----------
C = 2; %capa
R = 10; %resistance

ur =  -0.5; %reset potential
u0 = 0; % resting potential

q = 1.3; %total charge

tc = -100000;
th = 1; %the neuron threshold
taus = 5;
tauc = 10;

u = zeros(length(t), 1); %membrane potential

f = [10 20 30 50 60]; %the spike times of the presynaptic neuron
seps = 0;

for i=1:length(t);                    
    
     seps = 0;
     for j=1:length(f);
        
        eps = 0;
      
       if (tc <= f(j) && f(j) <= i)
           eps = exp(-(i -f(j))/(R*C)) - exp(-(i-f(j))/taus);
       end
      
       if (f(j) < tc && tc <= i)
           eps = exp(-(tc-f(j))/taus)*(exp(-(i-tc)/(R*C)) - exp(-(i-tc)/taus));
       end
      
       seps = seps + eps;
        
    end;
    
    u(i) = u0 + (ur - u0) * exp(-( i - tc) / (R*C))  +q/C * 1/(1-taus/(R*C))*seps;
  
  
        if(u(i) >= th)   %generate spike              
        tc = i;
        u(i) = ur;
        end
    
end



%plot membrane potential vs time
plot(t,u);
   hold on; plot([0 100],[1 1],'--');
   axis([0 100 -2 1.5])
   xlabel('time [\tau]');
   ylabel('u(t)')  



5.End
The aim of this short "tutorial" was to explain and implement a simple neuron. Of course there are other models out there. I just presented maybe the most basic one with which one can easily build a neural network that can be trained using some algorithm to complete a task.






References:


Gerstner W., Kistler ., Spiking Neuron Models. Single Neurons, Populations, Plasticity. Cambridge University Press, 2002

--
Muballit Mitte


Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!

fuzzylunkinz
Group Icon



post 7 Jan, 2009 - 07:16 PM
Post #2
This is exactly the kind of thing I'm into. At my age, I know nearly nothing about this stuff, but I feel like I was meant to do Artificial Intelligence.

Are there any good online resources about the subject that you could point to? What should I look at for schooling? (I'm planning on CS major/psych minor in undergrad school.)

Thanks for the tutorial,
Alecks Gates
Go to the top of the page
+Quote Post

muballitmitte
Group Icon



post 28 Apr, 2009 - 09:48 PM
Post #3
QUOTE(fuzzylunkinz @ 7 Jan, 2009 - 07:16 PM) *

This is exactly the kind of thing I'm into. At my age, I know nearly nothing about this stuff, but I feel like I was meant to do Artificial Intelligence.

Are there any good online resources about the subject that you could point to? What should I look at for schooling? (I'm planning on CS major/psych minor in undergrad school.)

Thanks for the tutorial,
Alecks Gates


thanks for your interest in ANN.

For school I would choose physics as a major with a CS minor. I for one am a math graduate but at the end it doesn`t really matter as long as you keep your eye open for the right courses. There are plenty of books which I could recommend, but maybe you could tell me a bit more about your interests.

CR

Go to the top of the page
+Quote Post

micalith
*



post 6 Jul, 2009 - 08:04 AM
Post #4
That's a nice simple I&F neruon you've made there. I've been trying to find some Matlab code for synapses. Woudl you have some, or else a link for some? My maths isn't good enough to create my own jsut yet.

Thanks
Go to the top of the page
+Quote Post

kmangold
Group Icon



post 6 Jul, 2009 - 08:09 AM
Post #5
http://www.heatonresearch.com/

The above site provides some pretty good tutorials and libraries for ANNs in both C# and Java.
Go to the top of the page
+Quote Post


Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/21/09 04:01AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month