Edit History

Wiki » History » Version 7

Ramon Martinez, 26 Jun 2014 12:16

1 2 Ramon Martinez
##  Network models of V1
2 1 Padraig Gleeson
3 1 Padraig Gleeson
This project will be used to test implementations in PyNN (and eventually NeuroML) of published models of primary visual cortex (V1) based on spiking point neurons.
4 1 Padraig Gleeson
5 1 Padraig Gleeson
An initial focus will be on pubmed:14614078, but other models investigated will include pubmed:19477158 and pubmed:22681694.
6 1 Padraig Gleeson
7 1 Padraig Gleeson
This project is part of the [INCF Google Summer of Code 2014](http://incf.org/gsoc/2014).
8 2 Ramon Martinez
9 2 Ramon Martinez
10 2 Ramon Martinez
### Troyer Model
11 2 Ramon Martinez
Here I will describe breifly the implementation of Troyer et al (1998). 
12 2 Ramon Martinez
13 2 Ramon Martinez
In order to run this model is necessary to first install [git](http://git-scm.com/) and [PyNN](http://neuralensemble.org/PyNN/) and the appropriate simulator.
14 2 Ramon Martinez
15 3 Ramon Martinez
After that you can clone directly from git using:
16 3 Ramon Martinez
17 3 Ramon Martinez
~~~
18 3 Ramon Martinez
git clone https://github.com/OpenSourceBrain/V1NetworkModels.git
19 3 Ramon Martinez
~~~
20 3 Ramon Martinez
21 6 Ramon Martinez
As the project stands at this moment the workflow can be described in two steps. First there is a script `produces_lgn_spikes.py` that creates the spike train for the cells in the Lateral Geniculate Nucleus (LGN). After the spikes are created they are stores in pickled format along with their respective positions to identify them downstream in the workflow. After we have the spikes train the file `lgn.py` uses the **PyNN's**  SpikeSourceArray to create an LGN array with the spikes that we have produced in the other file. Using the stored positions we can,  in the same file,  create the thalamo-cortical connectivity using a Gabor-like sampling mechanism. The next step is to create the cortical-cortical connections with the correlations between cortical cells' receptive fields. 
22 4 Ramon Martinez
23 4 Ramon Martinez
Next I describe the two first stages of the workflow, that is, the creation of the LGN spikes through the filtering of the stimuli and the thalamo-cortical connectivity
24 4 Ramon Martinez
25 4 Ramon Martinez
#### LGN - spikes
26 4 Ramon Martinez
27 4 Ramon Martinez
In brief, the Retina and the Thalamus part of the model can be represented by a spatio-temporal filter that, when convolved with the stimuli, will produce the firing rate of a given LGN cell. After that, we can use a non-homogeneous Poisson process to produce the corresponding spikes for each cell. We describe this in detail bellow.
28 4 Ramon Martinez
29 5 Ramon Martinez
###### Spatio-Temporal Receptive Field (STRF)
30 4 Ramon Martinez
31 5 Ramon Martinez
The file `kernel_functions.py` contains the code for creating the  STRF.  The spatial part of the kernel possess a **center-surround** architecture which is model as a different of Gaussians. The temporal part of the receptive field has a **biphasic** structure, we use the implementation describe in Cai et al (1998). The details of the implementation are described in detail in the companion blog of this project  [(link)](http://neuralensemble.blogspot.fr/2014/06/gsoc-open-source-brain-retinal-filter-i.html). Down here we present a kernel produce with this classes. The time here runs from left to right and from up to down as usual text, so we can see how the spatial components of the filter change in time with this series of two dimensional maps.
32 1 Padraig Gleeson
33 5 Ramon Martinez
![STRF](http://www.opensourcebrain.org/attachments/download/205/kernel.png)
34 1 Padraig Gleeson
35 5 Ramon Martinez
We also include a small script `center_surround_plot.py` that can be used to visualize the spatial component of the STRF and received immediate feedback on how the overall pattern changes when the parameters and resolutions are changed. 
36 5 Ramon Martinez
37 5 Ramon Martinez
###### Stimuli 
38 5 Ramon Martinez
The file `stimuli_functions.py` contains the code for creating the stimuli. In particular we used the implementation of a **full field sinusoidal grating** with the parameters described in the paper. Down here we show an example of the stimuli at a particular point in time for illustration purposes:
39 5 Ramon Martinez
40 5 Ramon Martinez
![stimuli](http://www.opensourcebrain.org/attachments/download/206/sinus_grating.png)
41 5 Ramon Martinez
42 5 Ramon Martinez
Here we also included a small script `sine_grating_plot.py` to visualize the sine grating at a particular point in time.
43 5 Ramon Martinez
44 5 Ramon Martinez
###### Convolution 
45 5 Ramon Martinez
46 6 Ramon Martinez
After we have the stimuli and the STRF we can use the **convolution** function defined in the file `analysis_functions.py` to calculate the response of LGN' neurons. The details of how the the convolution is implemented is described in the detail in the following entry of the blog [(link)](http://neuralensemble.blogspot.fr/2014/06/gsoc-open-source-brain-retinal-filter-ii.html). With this in our hand and using the parameters described in the paper we can already reproduce the first plot in Troyer's paper.  The file `lgn_firing_rate_troyer_plot1.py` in the repository does this automatically for us and give us the next plot:
47 1 Padraig Gleeson
48 6 Ramon Martinez
![troyer_plot](http://www.opensourcebrain.org/attachments/download/207/troyer_plot1a.png)
49 1 Padraig Gleeson
50 6 Ramon Martinez
Here we can see the firing rate for an on and for an off cell subjected to the same stimuli. Note that they are off-phase and also the contrast dependent response. The responses are rectified after back ground noise was added. 
51 6 Ramon Martinez
52 6 Ramon Martinez
###### Producing Spikes
53 6 Ramon Martinez
54 6 Ramon Martinez
After we have the firing rate of a neuron we can use the produce_spikes functions in the file `analysis_functions.py`. This functions takes the firing rate and using non-homogeneous Poisson process outputs an array with the spikes times.  We provide one file `produce_lgn_spikes_one.py` for testing variations of parameters and as an example showcase.
55 6 Ramon Martinez
56 6 Ramon Martinez
![example](http://www.opensourcebrain.org/attachments/download/208/spikes_example.png)
57 6 Ramon Martinez
58 6 Ramon Martinez
59 6 Ramon Martinez
###### Storing Spikes
60 7 Ramon Martinez
Now we have the complete mechanism of spike creation. In the file `produce_lgn_spikes.py`. This file creates a grid of positions (This should correspond to the grid of LGN cells that we are going to use in PyNN) and produces the list of spikes associated with them as well as the positions. The particular stoage format that we are using is `cPickled`. 
61 6 Ramon Martinez
62 6 Ramon Martinez
#### LGN - Network