6 Replies - 25385 Views - Last Post: 20 May 2010 - 03:04 PM Rate Topic: -----

#1 muballitmitte  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 174
  • View blog
  • 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
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.
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  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 8
  • View blog
  • 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
Was This Post Helpful? 0
  • +
  • -

#3 muballitmitte  Icon User is offline

  • D.I.C Regular
  • member icon

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

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

Posted 28 April 2009 - 10:48 PM

View Postfuzzylunkinz, 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 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
Was This Post Helpful? 0
  • +
  • -

#4 micalith  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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
Was This Post Helpful? 0
  • +
  • -

#5 kmangold  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • 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.
Was This Post Helpful? 0
  • +
  • -

#6 Guest_sanki*


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;
Was This Post Helpful? 0

#7 sanki_ros  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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;
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1