• Blog
  • Podcasts
  • Books
  • Resume / CV
  • Bonaccorso’s Law
  • Essays
  • Contact
  • Testimonials
  • Disclaimer

Giuseppe Bonaccorso

Artificial Intelligence – Machine Learning – Data Science

  • Blog
  • Podcasts
  • Books
  • Resume / CV
  • Bonaccorso’s Law
  • Essays
  • Contact
  • Testimonials
  • Disclaimer

Hodgkin-Huxley spiking neuron model in Python

08/19/2017 Artificial Intelligence Complex Systems Computational Neuroscience Neural networks Python No Comments

The Hodgkin-Huxley model (published on 1952 in The Journal of Physiology [1]) is the most famous spiking neuron model (also if there are simpler alternatives like the “Integrate-and-fire” model which performs quite well). It’s made up of a system of four ordinary differential equations that can be easily integrated using several different tools. The main idea is based on an electrical representation of the neuron, considering only Potassium (K) and Sodium (Na) voltage-gated ion channels (even if it can be extended to include more channels). A schematic representation is shown in the following figure:

The elements are:

  • Cm: a capacitance per unit area representing the membrane lipid-bilayer (adopted value: 1 µF/cm²)
  • gNa: voltage-controlled conductance per unit area associated with the Sodium (Na) ion-channel (adopted value: 120 µS/cm²)
  • gK: voltage-controlled conductance per unit area associated with the Potassium (K) ion-channel (adopted value: 36 µS/cm²)
  • gl: conductance per unit area associated with the leak channels (adopted value: 0.3 36 µS/cm²)
  • VNa: voltage source representing the electrochemical gradient for Sodium ions (adopted value: 115 mV)
  • VK: voltage source representing the electrochemical gradient for Potassium ions (adopted value: -12 mV)
  • Vl: voltage source that determines the leakage current density together with gl (adopted value: 10.613 mV)

In the scheme, the external stimulus current is not shown, however, we assume its presence as a current density (I) encoding the input signal. All the experimental values are the same proposed by the authors in [1] and refer to an equilibrium potential of 0 V. The system is defined through the following ODE system:

The first equation defines the derivative of Vm considering the external stimulus (I) and the contribution of K, Na, and leakage current densities. The variables n, m, and h are associated with the probability of each channel to open and they are strictly dependent on the nature of the channel. For example, the K channel is voltage-gated and has four sub-units that must be all open in order to allow the current to flow, therefore its probability is n to the power of 4. Sodium has a slightly more complex behavior and needs two different factors (m and h) with autonomous dynamics. The last three equations describe the ion-channel kinetic model by computing the derivatives of n, m, and h as functions of the same variables and two voltage-dependent functions. The first term is the number of closed channels that are opening, while the second term is the number of open channels that are closing.

Hodgkin and Huxley suggest the following functions:

In the simulation, we’re going to use a double-impulsive current density as stimulus (however, any other signal can be used to test different behaviors). The time range is [0, 50ms]:

The resulting impulsive neuron behavior is shown in the following plot:

It’s also possible to observe the limit cycles present in the dynamic system. In the following plot, the trajectories Vm – n, and Vm – m are plotted:

It’s possible to observe how the probabilities (proportional to n, m, and h) for ion-channels to be opened span from a minimum to a maximum value according to n and Vm in a cyclic fashion. This allows the oscillations: steady state, potential increase, spike, potential decrease, steady state.

The complete Python code is available in this GIST:

References:

  1. Hodgkin, A. L., Huxley, A. F., (1952), A quantitative description of membrane current and its application to conduction and excitation in nerve. The Journal of Physiology, 117 doi: 10.1113/jphysiol.1952.sp004764
  2. Abbott L. F., Dayan P., Theoretical Neuroscience: Computational and Mathematical Modeling of Neural Systems, The MIT Press

See also:

ML Algorithms Addendum: Hebbian Learning – Giuseppe Bonaccorso

Hebbian Learning is one the most famous learning theories, proposed by the Canadian psychologist Donald Hebb in 1949, many years before his results were confirmed through neuroscientific experiments.

Share:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Skype (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)

You can also be interested in these articles:

hodgkin-huxleyNeural networksneuronneurosciencepythonsimulation

ML Algorithms addendum: Mutual information in classification tasks

ML Algorithms Addendum: Hebbian Learning

Leave a Reply Cancel reply

Follow Me

  • linkedin
  • twitter
  • facebook
  • googlescholar
  • youtube
  • github
  • amazon
  • medium

Search articles

Latest blog posts

  • Mastering Machine Learning Algorithms Second Edition 02/03/2020
  • EphMrA 2019 Switzerland one day meeting 08/30/2019
  • Machine Learning Algorithms – Second Edition 08/28/2018
  • Recommendations and User-Profiling from Implicit Feedbacks 07/10/2018
  • Are recommendations really helpful? A brief non-technical discussion 06/29/2018

Subscribe to this blog

Join 2,199 other subscribers

Follow me on Twitter

My Tweets
Copyright © Giuseppe Bonaccorso. All Rights Reserved
Proudly powered by WordPress | Theme: Doo by ThemeVS.
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.