# A simple neuron model - The integrate and fire neuron

Page 1 of 1

## 6 Replies - 24131 Views - Last Post: 20 May 2010 - 03:04 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=72868&amp;s=06ebcb01b494f78d7dd69ff5cae44b29&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 muballitmitte

• D.I.C Regular

Reputation: 174
• Posts: 470
• Joined: 05-November 08

# A simple neuron model - The integrate and fire neuron

Posted 21 November 2008 - 12:22 AM

A simple neuron model - The integrate and fire neuron

1.Motivation
Ive 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

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

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

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

The implementation is provided in MATLAB.
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

Is This A Good Question/Topic? 1

## Replies To: A simple neuron model - The integrate and fire neuron

### #2 fuzzylunkinz

Reputation: 8
• Posts: 185
• Joined: 11-November 08

## Re: A simple neuron model - The integrate and fire neuron

Posted 07 January 2009 - 08: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

### #3 muballitmitte

• D.I.C Regular

Reputation: 174
• Posts: 470
• Joined: 05-November 08

## Re: A simple neuron model - The integrate and fire neuron

Posted 28 April 2009 - 10:48 PM

fuzzylunkinz, on 7 Jan, 2009 - 07:16 PM, said:

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 doesnt 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

### #4 micalith

Reputation: 0
• Posts: 1
• Joined: 06-July 09

## Re: A simple neuron model - The integrate and fire neuron

Posted 06 July 2009 - 09:04 AM

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

### #5 kmangold

Reputation: 11
• Posts: 167
• Joined: 24-June 09

## Re: A simple neuron model - The integrate and fire neuron

Posted 06 July 2009 - 09:09 AM

http://www.heatonresearch.com/

The above site provides some pretty good tutorials and libraries for ANNs in both C# and Java.

Reputation:

## Re: A simple neuron model - The integrate and fire neuron

Posted 20 May 2010 - 02:41 PM

could you please explain how u arrived at these steps
following steps....

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;

### #7 sanki_ros

Reputation: 0
• Posts: 1
• Joined: 20-May 10

## Re: A simple neuron model - The integrate and fire neuron

Posted 20 May 2010 - 03:04 PM

could you please explain how u arrived at these steps
following steps....
why is taus variable used.....
if more commenting is provided..it will be helpfull
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;