Introduction to Modeling and Computational Neuroscience using Python

Presentation on theme: "Introduction to Modeling and Computational Neuroscience using Python"— Presentation transcript:

Introduction to Modeling and Computational Neuroscience using Python
Randy Heiland Research Scientist Indiana University I wonder why. I wonder why. I wonder why I wonder. I wonder why I wonder why I wonder why I wonder! * * Surely You're Joking, Mr. Feynman! (Adventures of a Curious Character), Richard Feynman.

Overview Computational Science:
Experiments, Models, Simulations, Analyses Modeling Neuroscience Python programming Questions? (+ short survey)

Experiment Analysis Model Simulation u’ = f(u,v) v’ = g(u,v) Mental
e-07, e-05, e-08, e e-06, e-09, e-08, e-06, e-08, e-09, e-06, e-07, e-06, e+00, e-06, e-08, , e-06, e-08, e-06, e-06, e-09, e-08, e+00, e-08, e-07, e-05, e-09, e-06, [ e-07, e-08, e-08, e-08, e+00, e-09, 512 electrode chip Courtesy A.Litke Experiment Mental u’ = f(u,v) v’ = g(u,v) Analysis Model Mathematical Computational Science is a cycle of these 4 areas. An experiment may precede or follow a model. Regarding models, we’re mostly interested in mathematical models. Simulations: computer programs to solve models Analysis: interpretation/verification of simulation data Experiments: physical/chemical/bio/astro or even “thought” experiment (Einstein) Alan Litke’s 512-electrode chip for retina neurons Mental models: Heliocentric model of earth/sun (vs. geocentric) Analysis: we now have more data than we have computers or people’s time to analyze – and it’s growing fast! (e.g. medical devices; social n/w data; astronomy; etc etc) Step 1: … Step 2: … Simulation  Patterns, Structures, Causality… Procedural Courtesy of Indiana University

Modeling Using math to approximate some process (or data)
(physical, biological, chemical, social, …) Typically ignore some parameters for a more “reasonable” model (e.g., for your F=ma lab, you ignored friction) “ all models are wrong, but some are useful” Prof. Emer. George E. P. Box, Statistics, UW-Madison

Simulation Execution of a model in a computer program
Several computer languages: C/C++, Java, etc. Higher level languages: MATLAB, Python, etc. Solving some models may require the use of parallel computing. Possibly discuss HPC, dist’d computing, cloud computing (e.g. Amazon), GPUs, etc.

Python language Easy to use Interpreted Powerful
>>> (52*55)/3.0 >>> from math import * >>> cos(pi) -1.0 Easy to use Interpreted Powerful Free (“open source”); runs on all computers Used in many computational science tools

Simple model in Python Average monthly temperature
in Indiana (from weather.com)  A function as a model lowTemp=[19,22,30,41,52,61,65,63,55,43,34,23] plot(lowTemp,'o') # ‘o’  circular points time = arange(0, 12, 0.1) F = 22*sin(pi/6 * (time-pi)) + 42 plot(time,F) (Note that Python is “0-based indexing”)

Neuroscience Goal: understand relationship between neural structures and functions Help solve important problems Vision Memory Auditory Ponder/explain interesting topics Consciousness; self-awareness Altruism Why? – “Seen and hear”, 1999. (image of brain) Altruism: behavior by an animal/entity that is not beneficial to or may be harmful to itself but that benefits others of its species.

Concepts & Terminology
A neuron is a nerve cell. It contains a soma, dendrites, and axon. Soma (Combination of biology, chemistry, and physics) Microscopic image Illustrative image

Yes, it’s quite complex Soma Scanning Electron Microscope image SEM image: cutaway of (mouse) nerve ending and its synaptic vesicles (cellimagelibrary.org)

The scale of a model Models can be at different scales: molecular, cellular, multi-cellular, tissue, organ, organism, … A single neuron model is on a different space and time (“spatiotemporal”) scale than a brain region or whole brain model.

Larger number of neurons  complex signaling and networks
Rich-Club Organization of the Human Connectome The Journal of Neuroscience, 2 November 2011, 31(44): Martijn P. van den Heuvel and Olaf Sporns. Rich-Club Organization of the Human Connectome. M.P. van den Heuvel and O. Sporns. J. Neuroscience, 2 Nov 2011. 100 billion neurons in human brain (Thanks to Journal of Neuroscience and authors for permission to use this image)

“… it is intolerable that we do not have this information [connectional map] for the human brain. Without it there is little hope of understanding how our brains work…” (Crick 1993) 1962 Nobel Prize for Physiology or Medicine Q: who knows who Francis Crick was? Hint: James Watson, Maurice Wilkins, Rosalind Franklin Francis Crick,

Vision: conversion of light to electrical signals
Rubin’s vase: Danish psychologist Edgar Rubin, Visual perception; brain can only maintain one image (vase or face) at a time. Vase or Face? A Neural Correlate of Shape-Selective Grouping Processes in the Human Brain. Journal of Cognitive Neuroscience, Aug 2001, pg

Memory One of the main hypotheses in neuroscience is that memories are encoded in the strengths of synapses between neurons Plasticity – the ability to change as a result of experience Soma Mathematical Foundations of Neuroscience, Ermentrout and Terman, p. 168. How is it that we can remember events from many years ago, but not what happened at 2:37 yesterday? E.g. my Grandmother’s backrubs.

Overwhelmed yet? Let’s begin by modeling a single neuron How? Why?
An electrical circuit is a good starting model Why? Because it is an (chemo)electrical circuit

The nervous system of the human body contains axons whose membranes act as small capacitors. A membrane is capable of storing 1.2 x 10-9 C of charge across a potential difference of 0.07 V before discharging nerve impulses through the body. What is the capacitance of one of these axon membranes?  neuron spike

Single neuron simulation
Shows how ions are responsible for potential difference. Problem with these sims, they don’t show the math. - play the simulation to see V flip/spike

Simplified model of a neuron
RC circuit (Resistance-Capacitance) Ion transports act as a resistor. Cell membrane acts as a capacitor.

Leaky integrate-and-fire (LIF) model (#1)
Where variables refer to membrane’s: V = potential R = resistance I = current if t > t_rest; otherwise = 0 Note: for those who haven’t taken Calculus (yet), dV/dt is a derivative (not division) This equation is a differential equation It can be solved numerically Leaky integrate is from the RC-circuit model; Fire is the delta function

LIF in Python But it’s not very realistic… # initialize all variables
for i, t in enumerate(time): # loop over desired time if t > t_rest: V[i] = V[i-1] + (-V[i-1] + I*R) / tau * dt if V[i] >= V_threshold: V[i] = V[i] + V_spike t_rest = t + tau_ref plot(time,V) Numerical integration via forward Euler method. (Rf. But it’s not very realistic…

Hodgkin-Huxley model (#2)
1952 (Nobel Prize 1963) Giant squid  measure voltages  Circuit model - complete with Python sim. The Hodgkin-Huxley model for neural dynamics is one of the most successful models in computational neuroscience. Based on voltage-clamp experiments on the squid giant axon, the model incorporates voltage-sensitive ion channels into the circuit model of the membrane to describe the generation and propagation of action potentials Electrical circuit model A more complicated differential equation - has both linear and nonlinear components

What about modeling LOTS of neurons
To model a brain, we want to model a network of neurons Need models of both the spiking behavior and the synapse (transmission between neurons) In the human brain, each neuron is connected to several thousand other neurons.

Izhikevich model (#3) m=membrane potential; u=membrane recovery
if v >= 30 mV then v = c u = u + d m=membrane potential; u=membrane recovery Captures multiple types of spiking behavior Computationally fast enough to do many neurons

Izhikevich model (cont’d)
(plus many more) Izhikevich E.M. (2003)  Simple Model of Spiking Neurons. IEEE Transactions on Neural Networks, 14:

Analysis After you have a model and have run a simulation of the model, you need to analyze the resulting data. Similarly, data from an experiment needs to be analyzed. Transfer Entropy is just one such analysis technique (next slide) The Fourth Paradigm: Data-Intensive Scientific Discovery (2009)

Visualization of analysis results
Transfer Entropy (TE) measures the effect that one neuron’s spiking has on another neuron. max min Part of much larger TE matrix Graph displays of TE (with different thresholds)

DIY neuroscience experiments
(SpikerBox: \$50-\$100) output input Cockroach leg (it grows back) Cockroach leg

Sampling of Research[ers]
John Beggs, Physics, Indiana U. - experimental research (“brains in a dish”) and analysis of experimental and simulated data Susan Amara, Neurobiology, U. of Pittsburgh, past President of Society for Neuroscience. - molecular & cellular biology of transporters Olaf Sporns, Psychological and Brain Sciences, Indiana U. - computational cognitive neuroscience; neural networks; coined “Connectome” Nancy Kopell, Mathematics, Boston U. Co-Director of Center for Biodynamics - develops models for and analysis of networks of neurons, esp. rhythms and oscillations. (Joy Hirsch) Crick & James Watson famously discovered structure of DNA… led to an entire generation of research. Nancy Ko-PELL (studied under S. Smale at UC-Berkeley)

Some related textbooks

Summary Modeling uses math to approximate reality
Modeling occurs at multiple scales Neuroscience: understand relationship between neural structures and functions Python lets you experiment with computational neuroscience (for free)

IU might be of interest to you
Dept of Physics Biophysics, Biocomplexity School of Informatics and Computing Complex systems, computer science, data mining Dept of Pyschological and Brain Sciences Learning, computational models of … Biology, Chemistry, …

Thanks! Be curious. Be creative. Be nice to your neurons.
Questions & short survey

Vase or Face? A Neural Correlate of Shape-Selective Grouping Processes in the Human Brain. Journal of Cognitive Neuroscience, Aug 2001, pg - From Eye to Sight, Alan Litke Craddock TJA , Tuszynski JA , Hameroff S (2012) Cytoskeletal Signaling: Is Memory Encoded in Microtubule Lattices by CaMKII Phosphorylation? PLoS Comput Biol 8(3): e doi: /journal.pcbi

Analysis  publications
Simple model of spiking neurons. IEEE Transactions on Neural Networks (2003) 14: Complex network measures of brain connectivity: uses and interpretations. Neuroimage Sep;52(3): Extending Transfer Entropy Improves Identification of Effective Connectivity in a Spiking Cortical Network Model

Self-awareness Awareness of one’s own ability to think (humans, apes, dolphins, …) 1970 “mirror test” for chimpanzees Difficult to test I wonder why. I wonder why. I wonder why I wonder. I wonder why I wonder why I wonder why I wonder! * Prefrontal cortex

Effects of meditation experience on functional connectivity of distributed brain networks. Feb 2012.
“Participants with more meditation experience exhibited increased connectivity within attentional networks…”

Nerve cells are formed during fetal life and for a short time after birth. Unlike most cells, which have a fairly short lifespan, neurons in the brain live a long time. These cells can live for up to 100 years or longer. To stay healthy, living neurons must constantly maintain and repair themselves. Groups of neurons in the brain have special jobs. For example, some are involved with thinking, learning, and memory. Others are responsible for receiving information from the sensory organs (such as the eyes and ears) or the skin. Still others communicate with muscles, stimulating them into action.

Definitions (for this talk)
Model: math equation(s) to describe a process (physics,chemistry,biology,…) Simulation: computer program to solve the model Analysis: interpretation/verification of data from the simulation (or experiment) - Might be an algorithm instead of eqns (Stephen Wolfram) - Maybe not a computer; might be analog, e.g. an electrical circuit

Is it possible to use more of our brain?