[PYTHON] Let's simulate the Izhikevich neuron model on the web!

Introduction

I am not a specialist in neuroscience, but as long as I am doing research dealing with spiking neural networks, neuroscience is an inseparable field.

Deep neural networks, which are famous in the streets, are also a collection of mathematical models of nerve cells called ** formal neuron models **. Formal neurons do not have time-series data and are a fairly old model proposed in 1943 as a nerve cell model, but they are still used because they are compatible with deep learning today. ..

However, of course, in the field of neuroscience, many more biologically sophisticated mathematical models of nerve cells have been born. These usually have concepts such as "membrane potential" and "spike", and such models are called ** spiking neuron models (SNM) **. Furthermore, if it is put on a network, it is called ** spiking neural network (SNN) **. For SNN, read my old book What is a Spiking Neural Network.

Izhikevich Neuron Model (2003) By the way, the theme of this time is ** Izhikevich Neuron Model **, which is famous among the spiking neuron models. The LIF model is often used in engineering research, but this Izhikevich model is often used (I think) in medical research.

The reason is that the Izhikevich model can mimic the activities of various neurons simply by changing the parameters. Furthermore, it does not have the complexity of the Hodgkin-Huxley model, and has the great advantage of being able to efficiently simulate the detailed behavior of nerve cells. (ref. Implementing the Hodgkin-Huxley neuron model)

The Izhikevich model consists of the following two differential equations. $\frac{dv}{dt}=0.04v^{2} + 5v + 140 -u + I$ $\frac{du}{dt}=a(bv-u)$ ${\rm if}\ \ v\geq30,\ \ {\rm then}\ \ v\leftarrow c,\ u\leftarrow u+d$

At this time, $ v $ is the membrane potential [mV], $ t $ is the time [ms], $ u $ is the variable called the recovery variable, and $ I $ is the input current from the outside world. Also, $ (a, b, c, d) $ is a hyperparameter. $ a $ is a constant (time constant) that controls how much $ u $ is attenuated with time, $ b $ is the sensitivity of $ u $ to $ v $, $ c $ is the resting membrane potential, and $ d $ is A constant that affects the time it takes for the membrane potential to recover after $ v $ ignites.

Well, ** I don't think I can understand even if such a thing is written, so let's actually move it **.

Izhikevich Neuron Simulator I made a simulator that works on the Web.

Izhikevich Neuron Simulator -Neuron Simulator Running on the Web-

The back end is Python (Flask / NumPy), and the graph drawing is Javascript.

There are explanations of similar models and parameter setting examples, so please play with them. It can be used on smartphones, but it is recommended for PCs and tablets ** because the drawing will be crushed. In the case of a smartphone, it may be better to hold it sideways.

For example, if you leave the default settings and check $ I_ {DC} $ and simulate. izh_simu.png $⬇️$ rs.png

In this way, the membrane potential $ v $ and the recovery variable $ u $ calculated according to the determined input current are drawn.

In addition, the time resolution is finely set as $ dt = 2 ^ {-5} $ at the time of calculation, so chaos can be confirmed for the time being. chaos.png (Is this chaos ?? Please let me know if you are familiar with it.)

in conclusion

This article was an introductory article about Web applications. (Personally, I would be happy if you could use it for beginners in neuroscience or for a little guidance ...)

It's okay to just play, so I hope that more people will be interested in neuroscience by using it! If you have any problems, please comment on this article.

reference

  1. Let's express neural activity by differential equation, Yuji Ikegaya
  2. Simple Model of Spiking Neurons, M. Izhikevich, 2003

Recommended Posts

Let's simulate the Izhikevich neuron model on the web!
Let's touch on the Go language
Let's tune the model hyperparameters with scikit-learn!
Download files on the web with Python
Publish the current directory on the web server
Have pandas read the zip file on the web
Customize the model page on Django's admin screen
Until the web application is released on Sakura VPS
Monitor the training model with TensorBord on Jupyter Notebook
[Part 2] Let's build a web server on EC2 Linux
Make the model a string on a Django HTML template
Execute the command on the web server and display the result
Power on/off the USB port on the RaspberryPi 4 Model B