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.
Owner
Rabia KOÇ
Data Science Researcher
Rabia KOÇ
A Streamlit web-app for a data-science project that aims to evaluate if the answer to a question is helpful.

How useful is the aswer? A Streamlit web-app for a data-science project that aims to evaluate if the answer to a question is helpful. If you want to l

1 Dec 17, 2021
A 2-dimensional physics engine written in Cairo

A 2-dimensional physics engine written in Cairo

Topology 38 Nov 16, 2022
A probabilistic programming language in TensorFlow. Deep generative models, variational inference.

Edward is a Python library for probabilistic modeling, inference, and criticism. It is a testbed for fast experimentation and research with probabilis

Blei Lab 4.7k Jan 09, 2023
fds is a tool for Data Scientists made by DAGsHub to version control data and code at once.

Fast Data Science, AKA fds, is a CLI for Data Scientists to version control data and code at once, by conveniently wrapping git and dvc

DAGsHub 359 Dec 22, 2022
Meltano: ELT for the DataOps era. Meltano is open source, self-hosted, CLI-first, debuggable, and extensible.

Meltano is open source, self-hosted, CLI-first, debuggable, and extensible. Pipelines are code, ready to be version c

Meltano 625 Jan 02, 2023
Python tools for querying and manipulating BIDS datasets.

PyBIDS is a Python library to centralize interactions with datasets conforming BIDS (Brain Imaging Data Structure) format.

Brain Imaging Data Structure 180 Dec 18, 2022
Provide a market analysis (R)

market-study Provide a market analysis (R) - FRENCH Produisez une étude de marché Prérequis Pour effectuer ce projet, vous devrez maîtriser la manipul

1 Feb 13, 2022
Demonstrate a Dataflow pipeline that saves data from an API into BigQuery table

Overview dataflow-mvp provides a basic example pipeline that pulls data from an API and writes it to a BigQuery table using GCP's Dataflow (i.e., Apac

Chris Carbonell 1 Dec 03, 2021
Repository created with LinkedIn profile analysis project done

EN/en Repository created with LinkedIn profile analysis project done. The datase

Mayara Canaver 4 Aug 06, 2022
Shot notebooks resuming the main functions of GeoPandas

Shot notebooks resuming the main functions of GeoPandas, 2 notebooks written as Exercises to apply these functions.

1 Jan 12, 2022
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

7.7k Dec 30, 2022
A crude Hy handle on Pandas library

Quickstart Hyenas is a curde Hy handle written on top of Pandas API to allow for more elegant access to data-scientist's powerhouse that is Pandas. In

Peter Výboch 4 Sep 05, 2022
Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).

AWS Data Wrangler Pandas on AWS Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretMana

Amazon Web Services - Labs 3.3k Jan 04, 2023
Basis Set Format Converter

Basis Set Format Converter Repository for the online tool that allows you to enter a basis set in the form of text input for a variety of Quantum Chem

Manas Sharma 3 Jun 27, 2022
MoRecon - A tool for reconstructing missing frames in motion capture data.

MoRecon - A tool for reconstructing missing frames in motion capture data.

Yuki Nishidate 38 Dec 03, 2022
Python Project on Pro Data Analysis Track

Udacity-BikeShare-Project: Python Project on Pro Data Analysis Track Basic Data Exploration with pandas on Bikeshare Data Basic Udacity project using

Belal Mohammed 0 Nov 10, 2021
Find exposed data in Azure with this public blob scanner

BlobHunter A tool for scanning Azure blob storage accounts for publicly opened blobs. BlobHunter is a part of "Hunting Azure Blobs Exposes Millions of

CyberArk 250 Jan 03, 2023
DataPrep — The easiest way to prepare data in Python

DataPrep — The easiest way to prepare data in Python

SFU Database Group 1.5k Dec 27, 2022
Python utility to extract differences between two pandas dataframes.

Python utility to extract differences between two pandas dataframes.

Jaime Valero 8 Jan 07, 2023
Udacity-api-reporting-pipeline - Udacity api reporting pipeline

udacity-api-reporting-pipeline In this exercise, you'll use portions of each of

Fabio Barbazza 1 Feb 15, 2022