Exercise: Leaky integrate and fire odel of neural spike generation This exercise investigates a siplified odel of how neurons spike in response to current inputs, one of the ost fundaental properties of neurons. The leaky integrate and fire odel is based on the siple resistor-capacitor (RC) circuit that you will learn about here, with an extra rule: the odel neuron spikes whenever the ebrane potential surpasses a threshold. It is a siple and useful odel, but ignores the detailed biophysical echaniss behind spiking. In reality, neurons spike because of voltage-dependent ion channels. Besides these siplifications and apparent liitations the leaky integrate and fire is a useful odel to understand how neurons respond to a current input. Our intuition tells us that the rate at which spikes are produced is positively correlated with the strength of the input current delivered to the cell. We also understand that neurons cannot fire arbitrarily fast, so this correlation is liited by saturation and refractoriness. In this exercise we will quantify the relation between input strength and firing rate. We will visualize this relation by plotting an f-i curve (also called an activation function). This curve describes the firing rate of a neuron (f, the nuber of spikes per second) as a function of injected input current I. Additionally, we will analyze the distribution of the inter-spike intervals (the tiings between successive spikes) for different input currents. Part 1: RC passive odel of a cell: Building the odel In general we can odel the ebrane of a neuron as an RC circuit illustrated in Figure 1. There we depict the different electrical coponents, which are described in what follows. Figure 1: Equivalent electric (RC) circuit of a neurons ebrane The cell ebrane provides electrical insulation between the intracellular fluid and extracellular fluid that are two conductive edia. This creates a capacitor, a device that accuulates charge across the ebrane and therefore has the ability to integrate inputs over tie. The input is represented by a current source (I E ). Reeber that an integral is roughly a su. In this particular case the capacitor has the ability to add up charge over tie and therefore builds up a voltage difference across the ebrane (V ) that we refer as the ebrane potential. The capacitor has a capacitance proportional to the cell s surface area (A). A cell s total ebrane capacitance (C ) can be calculated as follows: C c A (1.1) 1
where c is the specific ebrane capacitance. Here, we assue c to be 10 nf/ 2. The current through the capacitor (I C ) is given by the following expression: dv I C C (1.2) dt The cell ebrane is not a perfect insulator. Pores in the ebrane l allow ions to ove across it and therefore the charge that was built up across the capacitor has a way to leak out. This explains the nae leaky integrator. A cell s total ebrane conductance (G ) represents how easily ions flow across the ebrane. Recall that conductance and resistance are inversely related to each other ( R 1/ G ). Note that the total conductance is also proportional to the cell s area, given by the following forula: G g A (1.3) where g is the specific ebrane conductance. Here, we assue g to be 0.5. You probably noticed that the resistor R is wired to a battery in Figure 1, which supplies a voltage E L. This is to reflect the resting ebrane potential of the neuron. In other words, neurons have a ebrane potential difference across the ebrane even when no electrical stiulation is applied. Therefore, E L odels this resting potential. Next, Oh s law gives the leakage current (I L ) through the resistor R : V E L I (1.4) L R Finally, Kirchhoff s current law states that su of current flowing into a junction/node ust be equal to the su of currents flowing out of that node. By looking at Figure 1 we can see that: I I I (1.5) C L E Thus, applying equations 1.3 and 1.4 to 1.5 we obtain the following: dv V E L C I E (1.6) dt which is a first-order, linear and autonoous ordinary differential equation. Review questions: Consider a spherical odel neuron of radius 0.04 and the c and g values given in the preceding section. Write MATLAB code to answer the following questions: R 1. What is the total surface area of this cell? Recall that the surface area of a sphere is A 4r 2, where r is the sphere s radius. 2. Calculate the total ebrane capacitance (C ). 2
3. Calculate the total ebrane conductance G and the total ebrane resistance R. Part 2: Dynaics of the RC odel So far we have a differential equation (1.6) that relates changes in applied external current to changes in the ebrane potential. This section focuses on how to nuerically solve this equation to understand how the neurons ebrane potential changes over tie. The idea is to find a function V (t) that solves equation 1.6 for any arbitrary applied current. The RC neuron response to an injected input current I E is prescribed by the differential equation 1.6. After soe rearrangeent equation 1.6 can be rewritten as: dv V (t) E L R I E (2.1) dt where V (t) is the ebrane potential at tie t, R is the ebrane resistance, C is the ebrane capacitance, I E (t) is the current injected, and R C is the ebrane tie constant. E L is the resting ebrane potential also known as the reversal potential of the leakage current (the current through resistor R ). We call this the resting potential because when there is no input current and the voltage is not changing, the ebrane voltage is equal to E L. You can verify this by setting dv /dt and I E (t) to 0. In the absence of input current this passive odel of a cell relaxes exponentially to ebrane potential E L. Alternatively, when input current is supplied this odeled cell relaxes exponentially towards E R I (t). L E So far we have a qualitative understanding on how this odel responds to input currents. However, we would like to track the ebrane potential as a function of tie for any arbitrary input current. One way to do so is to approxiate this differential equation by a difference equation, and use the coputer to nuerically integrate and find the solution for the ebrane potential. To do so, we will rewrite dv as V (t t) V(t) and replace dt by t, which after soe rearranging leads to the following difference equation: t E L V (t) R I E (t) V (t t) V (t) (2.2) where t is the integration tie-step, i.e. the tie elapsed fro t to t t. If the tie-step is sufficiently sall, the difference equation 2.2 provides a faithful representation of the differential equation 2.1. If we know the paraeters and the ebrane potential at tie 0 (known as the initial condition V 0 = V(t=0)) we can find the ebrane potential trajectory for any given input current. As described this odel is unable to generate spikes. In the following section we build on this odel to generate a siplified version of a spiking cell. 3
Part 3: The leaky integrate and fire odel The RC odel alone cannot produce action potentials as we have discussed in Parts 1 and 2. Nonetheless we can iic spiking behavior by setting an additional rule: that the odeled neuron eits a spike whenever the ebrane potential crosses a threshold value V th. After each spike, we will reset the ebrane voltage to a value V reset below threshold, and the odel will continue to integrate the input fro there. In this odel there is no echanistic/biophysical description of the action potentials. We just introduced a fire and reset rule after threshold crossing. This constitutes the leaky integrate and fire odel. The ebrane potential of this odel neuron is described by the sae differential equation as the RC passive odel of a cell described in Part 1 and therefore can be approxiated by equation 2.2. In the following we will study this odel via nuerical siulations. During siulations it is convenient to keep track of the ebrane potential and of spiking behavior. The latter can be tracked by introducing a vector that is zero whenever the ebrane potential is below threshold and gets a value 1 when the ebrane potential crosses threshold. This representation is called a binary spike train. For our siulations we will consider a leaky integrate and fire odel with the following paraeters: R 100 M C 200 pf E 70 V L V 60 V V E th reset L We will set the initial condition and integration tie-step for equation 1.4 as follows: V 0 E L t 0.01sec 4. Ipleent the leaky integrate and fire odel as a MATLAB function naed ylif. This function takes as input: (1) the paraeters of the odel, (2) the tie-step and initial condition 1, and (3) a scalar that sets the aplitude of the injected current. This function produces two outputs: (1) the ebrane potential obtained by iteratively solving equation 1.4 with the explained fire and reset rules, and (2) a binary spike train. 5. Let s try the function you just wrote. Exaine the output of the odel neuron to a constant current of 150 pa that is applied for 0.5 seconds. Plot the ebrane potential as a function of tie. What is the firing rate of this neuron (i.e. the nuber of spikes per second)? 6. Copute the inter-spike intervals (the tie between two subsequent spikes). The MATLAB functions find and diff ay be helpful. Is this an irregular or regular firing neuron? 7. How would you estiate the ean firing rate fro the ISIs? A key characteristic of neurons is their refractory period. This refers to a brief rest period after an action potential is fired, when the neuron is unable to fire again. We can add a refractory period to the leaky integrate and fire odel by holding the ebrane potential at V reset for the duration of the refractory period after each spike. 1 The paraeters, initial condition and tie-step can be incorporated into a structure to ake the function call shorter. 4
8. Make a copy of your ylif function and call it ylifref. Revise this new function to include a refractory period (t ref ) of 3 sec. 9. Exaine the output of the odel neuron to a constant current of 150 pa that is applied for 0.5 seconds. Plot the ebrane potential as a function of tie and check that your refractory period is properly working (zoo into your plot to verify this). 10. What is the firing rate of this neuron? How does it copare to the odel without a refractory? For the reinder of this exercise we will continue to use the LIF odel with a refractory period of 3 sec. Next, we will copute the f-i curve for this neuron. Reeber that this curve describes the firing rate of a neuron (f, the nuber of spikes per second) as a function of injected input current I. To do so we need to exaine the behavior of our odel cell with currents of different aplitudes. We will test currents in the interval 0 to 500 pa in increents of 10 pa. Each current step will be applied for 1 second. 11. Use your ylifref function to copute the f-i curve of this neuron. Plot the firing rate (nuber of spikes per second) as a function of current aplitude. What is the iniu current that will elicit a spike? In the case of the leaky integrate and fire odel the f-i curve has a closed analytical expression: V th E 0 if I L E R f (I E ) (2.3) R I E V 1 V E t E L reset th L ref ln if I E R I E E L V th R 12. Plot the siulated and theoretical curves on the sae figure. (Use the MATLAB coands hold on and hold off to do so.) Use a line for the theoretical curve and squares for the results of your siulation. To plot square arkers, add s to your plotting coand, e.g. plot(x,y,'s'). 13. Do the siulations atch the analytical expression? 14. Repeat your siulations with input currents in the range 0 to 10000 pa in increents of 100 pa. Redo the plot for the siulated and theoretical curves. What is the theoretical axiu firing rate this neuron can achieve? How is it related to the refractory period of your neuron? 15. Include this axiu theoretical value as a black dashed line asyptote in your previous plot. To do so you can type in MATLAB plot(x,y,'--k'). Part 4: Introducing variability in the spike ties So far our odel is able to produce regular spiking, as all the ISI sequence values are identical. A siple way to ake our odel ore realistic is to inject a noisy current so that the ties of threshold crossing are not so easily predictable. This will introduce variability in the ISIs that can be captured in an ISI distribution histogra. 5
A siple way to introduce a noisy current is by randoly selecting at each tie-step a current value fro a Gaussian distribution with ean I e and standard deviation. The MATLAB function randn will be helpful for generating noisy currents. Let s visualize the effect of this noisy current by running a siulation exaple 16. Make a copy of your ylifref function and nae it ylif. Modify the new copy to use rando stiulation. This function takes an extra input arguent that sets the standard deviation of the noisy current. Use the ylif function to stiulate your cell for 10 seconds with a noisy current that has a Gaussian distribution with ean I E = 200pA and standard deviation 200pA. Plot a histogra (coands hist, histc and bar will be helpful) of the ISI distribution. Copute the ean and standard deviation of the ISI distribution. Next, let s explore the effect of ore systeatically. To do so we will run a set of siulations of 10 seconds each where the ean of the is fixed but the standard deviation is increased. We will use Gaussian with ean I e = 200pA and will test values of standard deviation in the range 0 to 400pA in increents of 50 pa. 17. Using subplot, ake a nine-panel figure window. Fro left to right plot the ISI distribution for increasing values of. To facilitate visual coparison of the plots ake sure that the scales on the x-axes are the sae across panels (the coand xli will be helpful) and that you use the sae binning for all your histogras. 18. Let us quantify the effect of on firing rate using siple statistics. Make a two-panel figure window. In the left panel plot the ean ISI as a function of the agnitude of. On the right panel plot the standard deviation of the ISI as a function of. Interpret these plots. 19. Can you predict how the in the input current will affect the shape of the f-i curve? 20. To test your prediction copute and plot the f-i curve as described in point 11 but set to 400 pa. What has changed with respect to the less case? Why do you think people say this curve has a soft threshold? 6
MIT OpenCourseWare https://ocw.it.edu Resource: Brains, Minds and Machines Suer Course Toaso Poggio and Gabriel Kreian The following ay not correspond to a particular course on MIT OpenCourseWare, but has been provided by the author as an individual learning resource. For inforation about citing these aterials or our Ters of Use, visit: https://ocw.it.edu/ters.