Tkinter Izhikevich Neuron Model With Python

Overview

TKINTER IZHIKEVICH NEURON MODEL WITH PYTHON

Hodgkin-Huxley Model

It is a mathematical model for the generation and transmission of action potentials in neurons. The origin of this model is based on circuit theory. It describes the electrical properties of cells that respond to stimuli, such as neurons and heart muscles. It is a constantly dynamic system.

eg

It is the electrical equivalent circuit inside an axon. Part A: equivalent circuit for a very small portion of the dice. The resistance of the intercellular fluid is neglected. Part B: It is the electrical equivalent circuit that is formed by the sequential repetition of the circuit in the A part and corresponds to the whole membrane. Membrane potential in an active electrical equivalent circuit:

Ekran görüntüsü 2021-09-30 134542

Hodgkin-Huxley action potential equation; It is controlled by the Na gate, which enables activation by opening the depolarization result, the three m gate with fast motion, and an h gate with slow motion, which closes as a result of depolarization.

The K channel controls four slow-motion n-gate m-gates. If the highest conductivities corresponding to open Na and K channels are expressed as g(Na ) and gK, respectively;

trj

This connection is called the action potential equation propagated by Hodgkin-Huxley.

yj

Here, action potential and the number of sodium and potassium channels opened at that moment represent the spatial distribution of events at a given time, while the right-to-left spread of stimuli, the graph shows how events change over time at a given time. Since the action potential is an undamped wave motion, the position of the axon also determines it.

Izhikevich Neuron Model

Eugene M. Izhikevich stated in 2003 that two conditions are necessary for the development of brain models. These are computational simplicity and the ability to produce rich firing patterns. According to Izhikeivich, the Hodgkin-Huxley model is the most biophysically accurate but difficult to simulate neuron model. On the other hand, the integrated flesh-and-fire neuron model is computationally feasible, but not suitable for spikes of cortical neurons. The Izhikevich neuron model is a neuron model where the plausible aspects of these two neuron models meet: It is computationally efficient and realistic enough to simulate the spikes of cortical neurons.

Ekran görüntüsü 2021-09-28 145151 # 2.1 - 2.2

In the equation, the equations of the Hodgkin-Huxley model are reduced to a two-dimensional system by bifurcation methodologies. The post-jump reset equation is shown below.

Ekran görüntüsü 2021-09-28 145312 # 2.3

v and u are dimensionless variables; a, b, c, d dimensionless parameters; t time. The variable v represents the membrane potential of the neuron; The variable u was used to represent activation of K+ ionic currents and deactivation of Na+ ionic currents, i.e. membrane recovery variable. If the jump reaches +30mV, the membrane voltage and recovery variable are reset (Equation (2.3)). It is the 0.04v 2 + 5v + 140 part in Eq.(2.1) that allows the variable v representing the membrane potential to have the ms scale of the mV and the time representing the t value.

According to the equations, the listening potential varies between 70-60 mV. Membrane potential before jumping can be at least -55 mV and at most -40 mV. The value that defines the time scale of u is a. The smaller the values, the slower it heals. The parameter that defines the sensitivity of u and v variables to sub-threshold fluctuations is parameter b. A large value for this parameter results in stronger binding of the variables v and u. Fast high threshold K+ conductivities cause a jump in the v variable, and slow high threshold K+ and N a+ conductivities cause a jump in u variable.

After the sudden jump of these values, reset parameters are c and d parameters, respectively. The different selection of these parameters allows various dynamics to occur, as shown in the figure.

Equations of the Izhikevich neuron model, the effect of parameters a, b, c, d on the action potential, the response of excitatory corticol neurons (RS, IB, CH) and cortical inhibitory neurons to constant current:

Ekran görüntüsü 2021-09-28 144432

Neocortical neurons are classified according to the types of jumps. Excitatory cortical cells are divided into three classes:

  • RS: When RS neurons, the most specific neurons in the cortex, are stimulated by a constant stimulus, it starts with a few sudden jumps at first. It then continues to jump with a lower frequency. Increasing the power of the stimulus decreases the frequencies. In RS neuron type, c parameter is -65mV, d parameter is 8.

  • IB: In the face of a constant stimulus, this neuron model first begins with an irregular and almost continuous jump. At this time, the variable u is created. Then repetitive jumps occur. The c and d parameters are -55mV and 4, respectively.

  • CH: These neurons jump one after the other in response to a fixed value stimulus and line up in a heap. The frequency between hops can be as high as 40Hz. In this neuron type, the c parameter is -50mV and the d parameter is 2.

Inhibitory cortical cells are divided into two classes:

  • FS: Performs high frequency jumps without adapting to a fixed value stimulus. Parameter a corresponds to a value of 0.1.

  • LTS: It starts with high frequency adaptation. It continues with a decreasing but still higher frequency. The reason for the low ignition threshold is that parameter b is 0.25. In addition, the stimulus response of thalamo-cortical neurons that provide the main input to the cortex is simulated with this model:

  • TC: These neurons jump in two different ways. In the first state, it is the resting state and then the depolarized state. At rest, the variable v is around -60mV. The next state is the hyperpolarization state, in which a negative stimulus is given. The v variable is around -90Mv.

The model can model other types of neurons:

  • RZ: Such neurons have damped and sustained oscillations. Parameter a is 0.1 and parameter b is 0.26.

The Izhikevich neuron model enabled the modeling of many different types of neurons in the brain. The compatibility of the equations we have explained above with the behavior of other neurons is also explained. It also helps to simulate large-scale neuronal networks.


Project Draft Diagrams:

Conversation tree example - Conversation tree example (7) egr

Tkinter Izhikevich Model Simulate Output:

WhatsApp Image 2021-10-01 at 12 02 54

Required explanations for "Tkinter_Sound_Record_Abs_Half_Offset" python file:

In the first studies, I made a sound recording by interfacing with the "Tkinter" library. I visualized 3 different processes that I applied to the audio signal to get rid of negative (-) values. The 2 seconds long audio from the user was recorded and the raw audio was plotted in dark blue. I got graphs drawn in red with full wave rectification, half wave rectification and offset summation. I chose one of these 3 different methods to be used in the first stage of the signal processing steps, I got rid of the negative (-) values. I chose the full-wave rectifier operation to keep the signal between 0-1 to avoid data loss during the processing of the audio signal, avoid fluctuations in the signal, and preserve the authenticity of the data.

The audio signal, full-wave rectified audio signal, half-wave rectified audio signal, and added offset audio signal:

WhatsApp Image 2021-10-01 at 11 53 34 WhatsApp Image 2021-10-01 at 11 55 24 WhatsApp Image 2021-10-01 at 11 56 22

Required explanations for the file "Hilbert_Moving_Average_Method_Sounddevice":

I tried moving averages and Hilbert methods to create the envelope of the audio signal in the processing phase. I separated the background noise from the main audio data by taking 3 times the standard deviation of the first 0.1 seconds. The inconsistency of the amplitudes of the envelope values with the original values in the moving average method, which is done by writing the average of the values instead of the median value in an imaginary window walking on the signal, enabled me to discover Hilbert. I have observed that the "hilbert" command from the "scipy.signal" library, which is based on the Fourier transform, successfully creates the envelope of the sound at each frequency.

Moving Average Method and Hilbert Method Applied to Audio Signal:

  • The response of the RS neuron type as a result of the sound signal passing through the signal processing stages: WhatsApp Image 2021-10-01 at 14 49 54 WhatsApp Image 2021-10-01 at 12 54 57

A 2 second audio recording was taken from the user and I visualized the results of the two methods. In the graph of the moving average method, while the envelopes of high-frequency sounds are smoother, anomalies have occurred in the envelopes of low-frequency sounds.

In the next work, the envelope of the 2-second audio signal received from the user is equalized to the input current in the Izhikevich model. Optimization is achieved by dividing 10 times the data of each envelope by the maximum value in the signal while synchronizing. In the interface, 3 different neuron type options are presented to the user. Differences were observed in the response of neuron types to the sound signal. In the images below, the raw sound in purple, the full rectifier sound in orange, the envelope of the sound signal in black and the response of each neuron type in blue are visualized. In the continuation of this study, another button was presented to the user and the neuron response was reflected to the speaker. While doing this, the "play" command in the "sounddevice" library was used for non-real-time work. In the latest real-time study, the model's response data was converted to a "byte" type and projected onto the speaker.

  • The response of the IB neuron type as a result of the sound signal passing through the signal processing stages: WhatsApp Image 2021-10-01 at 14 52 15 WhatsApp Image 2021-10-01 at 12 56 01

  • The response of the FS neuron type as a result of the sound signal passing through the signal processing stages: WhatsApp Image 2021-10-01 at 14 51 27 WhatsApp Image 2021-10-01 at 12 55 28


Tkinter Playback Izhikevich Neuron Model Output:

WhatsApp Image 2021-10-01 at 12 33 29

FINAL PROJECT

  • After all these preliminary studies, sufficient information was gathered for the final project. The code starts the audio recording process from the first second. In parallel with the sound recording process, the sound is processed, assigned to the model and reflected to the output as sound. When the user starts speaking or the sound reaches the microphone, the model responds through the speaker and chats with the user.
You might also like...
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano
Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano

PyMC3 is a Python package for Bayesian statistical modeling and Probabilistic Machine Learning focusing on advanced Markov chain Monte Carlo (MCMC) an

Statsmodels: statistical modeling and econometrics in Python

About statsmodels statsmodels is a Python package that provides a complement to scipy for statistical computations including descriptive statistics an

A computer algebra system written in pure Python

SymPy See the AUTHORS file for the list of authors. And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's part

ForecastGA is a Python tool to forecast Google Analytics data using several popular time series models.
ForecastGA is a Python tool to forecast Google Analytics data using several popular time series models.

ForecastGA is a tool that combines a couple of popular libraries, Atspy and googleanalytics, with a few enhancements.

Multiple Pairwise Comparisons (Post Hoc) Tests in Python
Multiple Pairwise Comparisons (Post Hoc) Tests in Python

scikit-posthocs is a Python package that provides post hoc tests for pairwise multiple comparisons that are usually performed in statistical data anal

Hidden Markov Models in Python, with scikit-learn like API

hmmlearn hmmlearn is a set of algorithms for unsupervised learning and inference of Hidden Markov Models. For supervised learning learning of HMMs and

Deep universal probabilistic programming with Python and PyTorch
Deep universal probabilistic programming with Python and PyTorch

Getting Started | Documentation | Community | Contributing Pyro is a flexible, scalable deep probabilistic programming library built on PyTorch. Notab

Fast, flexible and easy to use probabilistic modelling in Python.
Fast, flexible and easy to use probabilistic modelling in Python.

Please consider citing the JMLR-MLOSS Manuscript if you've used pomegranate in your academic work! pomegranate is a package for building probabilistic

Python Library for learning (Structure and Parameter) and inference (Statistical and Causal) in Bayesian Networks.

pgmpy pgmpy is a python library for working with Probabilistic Graphical Models. Documentation and list of algorithms supported is at our official sit

Owner
Rabia KOÇ
Data Science Researcher
Rabia KOÇ
The OHSDI OMOP Common Data Model allows for the systematic analysis of healthcare observational databases.

The OHSDI OMOP Common Data Model allows for the systematic analysis of healthcare observational databases.

Bell Eapen 14 Jan 2, 2023
Creating a statistical model to predict 10 year treasury yields

Predicting 10-Year Treasury Yields Intitially, I wanted to see if the volatility in the stock market, represented by the VIX index (data source), had

null 10 Oct 27, 2021
A model checker for verifying properties in epistemic models

Epistemic Model Checker This is a model checker for verifying properties in epistemic models. The goal of the model checker is to check for Pluralisti

Thomas Träff 2 Dec 22, 2021
A program that uses an API and a AI model to get info of sotcks

Stock-Market-AI-Analysis I dont mind anyone using this code but please give me credit A program that uses an API and a AI model to get info of stocks

null 1 Dec 17, 2021
Used for data processing in machine learning, and help us to construct ML model more easily from scratch

Used for data processing in machine learning, and help us to construct ML model more easily from scratch. Can be used in linear model, logistic regression model, and decision tree.

ShawnWang 0 Jul 5, 2022
Example Of Splunk Search Query With Python And Splunk Python SDK

SSQAuto (Splunk Search Query Automation) Example Of Splunk Search Query With Python And Splunk Python SDK installation: ➜ ~ git clone https://github.c

AmirHoseinTangsiriNET 1 Nov 14, 2021
Business Intelligence (BI) in Python, OLAP

Open Mining Business Intelligence (BI) Application Server written in Python Requirements Python 2.7 (Backend) Lua 5.2 or LuaJIT 5.1 (OML backend) Mong

Open Mining 1.2k Dec 27, 2022
Incubator for useful bioinformatics code, primarily in Python and R

Collection of useful code related to biological analysis. Much of this is discussed with examples at Blue collar bioinformatics. All code, images and

Brad Chapman 560 Jan 3, 2023
Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Karate Club is an unsupervised machine learning extension library for NetworkX. Please look at the Documentation, relevant Paper, Promo Video, and Ext

Benedek Rozemberczki 1.8k Jan 9, 2023