42
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.

Introduction to Modeling and Computational Neuroscience using Python

  • Upload
    ember

  • View
    138

  • Download
    0

Embed Size (px)

DESCRIPTION

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! *. - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to Modeling and Computational Neuroscience using Python

Introduction to Modeling and Computational Neuroscience

using Python

Randy HeilandResearch ScientistIndiana 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.

Page 2: Introduction to Modeling and Computational Neuroscience using Python

Overview

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

Page 3: Introduction to Modeling and Computational Neuroscience using Python

0.00000000e+00, 7.59139762e-07, 1.39243600e-07, 3.508636 5.32143167e-05, 2.44901501 1.73985789e-08, 0.00000000e+00 1.45115517e-06, 4.93031343e-09, 3.11438363e-08, 1.92049751e-06, 2.16824470e-08, 6.40914027e-09, 2.65017478e-06, 7.59736245e-07, 1.45118790e-06, 0.00000000e+00, 3.30347955e-06, 7.32821449e-08, , 7.22468653e-06, 1.50957302e-08, 1.05983595e-06, 2.70174543e-06, 4.93023466e-09, 1.16339858e-08, 0.00000000e+00, 4.09147792e-08, 5.44135943e-07, 2.33556551e-05, 8.26447814e-09, 3.32418446e-06, [ 2.56281682e-07, 3.11322475e-08, 7.34055651e-08, 4.09002090e-08, 0.00000000e+00, 3.82542228e-09,

Experiment

AnalysisModel

Simulation

u’ = f(u,v)v’ = g(u,v)

Step 1: …Step 2: ……

Mental

Mathematical

Procedural

Courtesy of Indiana University

Patterns,Structures,Causality…

512 electrode chipCourtesy A.Litke

Page 4: Introduction to Modeling and Computational Neuroscience using Python

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

Page 5: Introduction to Modeling and Computational Neuroscience using Python

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.

Page 6: Introduction to Modeling and Computational Neuroscience using Python

Python language

• Easy to use• Interpreted• Powerful• Free (“open source”); runs on all computers• Used in many computational science tools

>>> (52*55)/3.0953.3333333333334>>> from math import *>>> cos(pi)-1.0

Page 7: Introduction to Modeling and Computational Neuroscience using Python

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 pointstime = arange(0, 12, 0.1)F = 22*sin(pi/6 * (time-pi)) + 42plot(time,F)

(Note that Python is “0-based indexing”)

Page 8: Introduction to Modeling and Computational Neuroscience using Python

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?

Page 9: Introduction to Modeling and Computational Neuroscience using Python

Soma

A neuron is a nerve cell.It contains a soma, dendrites, and axon.

Microscopic imageIllustrative image

(Combination of biology, chemistry,and physics)

Concepts & Terminology

Page 10: Introduction to Modeling and Computational Neuroscience using Python

Yes, it’s quite complex

Soma

SEM image: cutaway of (mouse) nerve ending and its synaptic vesicles(cellimagelibrary.org)

Page 11: Introduction to Modeling and Computational Neuroscience using Python

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.

Page 12: Introduction to Modeling and Computational Neuroscience using Python

Larger number of neurons complex signaling and networks

100 billion neurons in human brain(Thanks to Journal of Neuroscience and authors for permission to use this image)

Rich-Club Organization of the Human Connectome.M.P. van den Heuvel and O. Sporns. J. Neuroscience, 2 Nov 2011.

Page 13: Introduction to Modeling and Computational Neuroscience using Python

• “… 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)

Francis Crick, 1916-2004

Q: who knows who Francis Crick was?Hint: James Watson, Maurice Wilkins, Rosalind Franklin

Page 14: Introduction to Modeling and Computational Neuroscience using Python

Vision: conversion of light to electrical signals

Page 15: Introduction to Modeling and Computational Neuroscience using Python

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

Page 16: Introduction to Modeling and Computational Neuroscience using Python

Overwhelmed yet?

• Let’s begin by modeling a single neuron• How?– An electrical circuit is a good starting model

• Why?– Because it is an (chemo)electrical circuit

Page 17: Introduction to Modeling and Computational Neuroscience using Python

From your past homework

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

Page 18: Introduction to Modeling and Computational Neuroscience using Python

http://phet.colorado.edu/en/simulation/neuron - play the simulation to see V flip/spike

Single neuron simulation

Page 19: Introduction to Modeling and Computational Neuroscience using Python

Simplified model of a neuron

http://phet.colorado.edu/en/simulation/circuit-construction-kit-ac-virtual-lab

RC circuit (Resistance-Capacitance)

Cell membrane acts as acapacitor.

Ion transports act as a resistor.

Page 20: Introduction to Modeling and Computational Neuroscience using Python

Leaky integrate-and-fire (LIF) model (#1)

• 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

Where variables refer to membrane’s:V = potentialR = resistanceI = current

if t > t_rest; otherwise = 0

Page 21: Introduction to Modeling and Computational Neuroscience using Python

LIF in Python

(Rf. www.neurdon.com/tag/spiking-neurons)

# 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 viaforward Euler method.

But it’s not very realistic…

Page 22: Introduction to Modeling and Computational Neuroscience using Python

Hodgkin-Huxley model (#2)• 1952 (Nobel Prize 1963)

Giant squid measure voltages Circuit model

• Electrical circuit model• A more complicated differential equation

- has both linear and nonlinear components

Page 23: Introduction to Modeling and Computational Neuroscience using Python

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.

http://connectomethebook.com/?page_id=58#all

Page 24: Introduction to Modeling and Computational Neuroscience using Python

Izhikevich model (#3)

• m=membrane potential; u=membrane recovery• Captures multiple types of spiking behavior• Computationally fast enough to do many neurons

if v >= 30 mV then v = c

u = u + d

Page 25: Introduction to Modeling and Computational Neuroscience using Python

• Izhikevich E.M. (2003) Simple Model of Spiking Neurons. IEEE Transactions on Neural Networks, 14:1569- 1572

Izhikevich model (cont’d)

(plus many more)

Page 26: Introduction to Modeling and Computational Neuroscience using Python

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)– http://research.microsoft.com/en-us/collaboration/fourthparadigm

Page 27: Introduction to Modeling and Computational Neuroscience using Python

Visualization of analysis results

Graph displays of TE (with different thresholds)

Transfer Entropy (TE) measures the effect thatone neuron’s spiking has on another neuron.

Part of much larger TE matrix

min

max

Page 28: Introduction to Modeling and Computational Neuroscience using Python

DIY neuroscience experiments

http://www.youtube.com/watch?v=edEXKiOmPvE

output

input

www.backyardbrains.com (SpikerBox: $50-$100)

Cockroach leg

Page 29: Introduction to Modeling and Computational Neuroscience using Python

Sampling of Research[ers]John Beggs, Physics, Indiana U. - experimental research (“brains in a dish”) andanalysis of experimental and simulated data

Nancy Kopell, Mathematics, Boston U.Co-Director of Center for Biodynamics- develops models for and analysis of networks of neurons, esp. rhythms and oscillations.

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”

Page 30: Introduction to Modeling and Computational Neuroscience using Python

Some related textbooks

Page 31: Introduction to Modeling and Computational Neuroscience using Python

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)

Page 32: Introduction to Modeling and Computational Neuroscience using Python

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, …

Page 33: Introduction to Modeling and Computational Neuroscience using Python

Questions & short survey

Thanks!

Be curious. Be creative. Be nice to your neurons.

Page 34: Introduction to Modeling and Computational Neuroscience using Python

Further reading/References

• http://www.neurdon.com/tag/spiking-neurons/• http://connectomethebook.com/• Vase or Face? A Neural Correlate of Shape-Selective Grouping Processes in the

Human Brain. Journal of Cognitive Neuroscience, Aug 2001, pg 744-753• http://www.scientificamerican.com/article.cfm?id=is-it-possible-to-use-more• http://blogs.scientificamerican.com/streams-of-consciousness/2011/09/28/goldie-h

awn-plunges-into-brain-science/

• http://faculty.washington.edu/chudler/what.html • http://www.symmetrymagazine.org/cms/?pid=1000591 - 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): e1002421. doi:10.1371/journal.pcbi.1002421 http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1002421

Page 35: Introduction to Modeling and Computational Neuroscience using Python

Analysis publications• Simple model of spiking neurons. IEEE Transactions on Neural Networks (2003) 14:1569- 1572

• Complex network measures of brain connectivity: uses and interpretations.

Neuroimage. 2010 Sep;52(3):1059-69

• Extending Transfer Entropy Improves Identification of Effective Connectivity in a Spiking Cortical Network Model

Neuroimage. 2010 Sep;52(3):1059-69

Page 36: Introduction to Modeling and Computational Neuroscience using Python

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! *

Page 37: Introduction to Modeling and Computational Neuroscience using Python

• Effects of meditation experience on functional connectivity of distributed brain networks. Feb 2012.

www.frontiersin.org/human_neuroscience/10.3389/fnhum.2012.00038/abstract“Participants with more meditation experience exhibited increased connectivity within attentional networks…”

Page 38: Introduction to Modeling and Computational Neuroscience using Python

• 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.

Page 39: Introduction to Modeling and Computational Neuroscience using Python

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)

Page 40: Introduction to Modeling and Computational Neuroscience using Python

Is it possible to use more of our brain? Barry Gordon, professor of neurology and cognitive science at the Johns Hopkins University School of Medicine, repliesScientific American| Saturday, March 3, 2012 | 2

Yes! Though perhaps not how you might imagine. You can't put more of your brain to work. Your whole brain is working all the time, even when you think you're just being lazy. What you can do is make it work more productively.There are two proved strategies to make your neural systems more efficient. The first strategy is to focus, which is hard to do. It is quite difficult to force your brain to stay on task and to shut off extraneous thoughts. Yet by concentrating, your brain can muster the neural tools it needs to tackle a complex problem. In fact, intense focus may be one reason why so-called savants become so extraordinary at performing extensive calculations or remembering a slew of facts.The second approach is optimization. The human brain is far from an ideal "thinking machine." Our mental processes are slow, and the accuracy of our memory is far from perfect. Our intrinsic limitations are compounded by the simple mental blunders we make; these unhelpful tendencies, however, are correctable. For instance, you can become a better problem solver by looking beyond your personal biases and blind spots to consider alternative solutions. The more you learn to recognize and seek a variety of answers, the better your brain will be at finding optimal solutions.Some proof that focus and optimization can improve the brain's performance comes from research on video gamers. Neuroscientists at the University of Rochester have shown that even novice gamers can improve cognitive skills such as perception and attention by playing action video games. These games can strengthen players' mental acuity because they require intense concentration and ruthless self-correction (otherwise, your friends shoot you!).Sometimes, however, you may think better when you're not trying so hard. (You have to consider all the alternatives.) Periods of artistic and scientific creativity—when people often tackle the biggest, most open-ended problems—usually require letting your brain meander, percolate, chill. It may not feel like you are using more of your brain when you unleash it in this way, but one virtue of the human brain is that it often does its best work when it does not seem to be working at all.

Page 41: Introduction to Modeling and Computational Neuroscience using Python

1-min lesson in Diff. Eq.

• Geometric interpretation• Show sin(x), tangent/deriv cos(x)• d/dt F(x) = cos(x)

Page 42: Introduction to Modeling and Computational Neuroscience using Python

This confocal micrograph shows specialized cells named Purkinje cells (red) that are found in a part of the brain called the cerebellum. They send out vast numbers of branches that make connections with other cells in the cerebellum. This part of the brain co-ordinates your voluntary movements and keeps you oriented in space. It also plays a part in learning physical skills - like riding a bike or playing the piano.