Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python is for the birds and for the brains

David Nicholson
August 17, 2016
61

Python is for the birds and for the brains

PyData Atlanta presentation. August 17th, 2016.

David Nicholson

August 17, 2016
Tweet

Transcript

  1. Why Neuroscience Needs Python the two Rs of scientific python,

    and a couple of corollaries • Readability – ⇒ “writability”
  2. Why Neuroscience Needs Python the two Rs of scientific python,

    and a couple of corollaries • Readability – ⇒ “writability” • Reproducibility (of analysis) – Jupyter notebook / JupyterLab – ⇒ A level playing field
  3. Why Neuroscience Needs Python the two Rs of scientific python,

    and a couple of corollaries • Readability – ⇒ “writability” • Reproducibility – Jupyter notebook / JupyterLab – ⇒ A level playing field • Oh, and also: – Employability • One of top 5 languages
  4. Songbirds: a model system … for neuroscience • learn song

    – socially, from a tutor picture: Jon Sakata 2016 spectrogram: http://doolinglab.umd.edu/zebra_finch.htm
  5. Songbirds: a model system … for neuroscience • learn song

    – socially, from a tutor – during a critical period in development picture: Jon Sakata 2016 spectrogram: http://doolinglab.umd.edu/zebra_finch.htm
  6. Songbirds: a model system … for neuroscience • learn song

    – socially, from a tutor – during a critical period in development – practice and improve using sensorimotor learning picture: Jon Sakata 2016 spectrogram: http://doolinglab.umd.edu/zebra_finch.htm
  7. Songbirds • have evolved a network of brain areas for

    learning and producing song, the song system Bolhuis et al. PNAS 2000;97:2282-2285
  8. • but the song system sits within brain regions that

    birds share with humans, regions conserved across evolution – e.g. the basal ganglia
  9. • but the song system sits within brain regions that

    birds share with humans, regions conserved across evolution – e.g. the basal ganglia
  10. Songbirds • provide a model system where we can record

    electrical activity in the brain activity and relate that to muscle activity and behavior Samuel J. Sober et al. J. Neurosci. 2008;28:10370-10379
  11. Songbirds • a “model system” of neuroscience • because multidisciplinary

    – what about the fields I left out? Let’s look at an example where Python helps: • bridge the gaps between fields • make it easier to produce readable, reproducible research
  12. Birdsong and machine learning • Birds typically sing hundreds of

    songs a day, many more than can be studied by hand
  13. Birdsong and machine learning • Birds typically sing hundreds of

    songs a day, many more than can be studied by hand • Previous papers applied machine learning algorithms to classifying syllables
  14. Birdsong and machine learning • Birds typically sing hundreds of

    songs a day, many more than can be studied by hand • Previous papers applied machine learning algorithms to classifying syllables • No study has compared different algorithms
  15. machine learning (and birdsong) • Supervised learning – algorithms that

    produce classifiers • trained with an n-element training set of feature vectors – {yi , xi }, i = 1,2,3,…,n where » y is the correct class / label » x is a vector of m features – x = {x1 , x2 , x3 , … xm } – e.g., for syllables » {amplitude, pitch, duration,…}
  16. Birdsong and machine learning • Two previously published papers applying

    machine learning to Bengalese Finch song – k nearest neighbors (k-NN)
  17. Birdsong and machine learning • Two previously published papers applying

    machine learning to Bengalese Finch song – support vector machine (SVM)
  18. Birdsong and machine learning • methods: – generate large hand-labeled

    datasets for four birds – extract features from syllables used to train algorithms
  19. Birdsong and machine learning • methods: – generate large hand-labeled

    datasets for four birds – extract features from syllables used to train algorithms – use sci-kit learn to facilitate training models, measuring accuracy
  20. Birdsong and machine learning • methods: – generate large hand-labeled

    datasets for four birds – extract features from syllables used to train algorithms – use sci-kit learn to facilitate training models, measuring accuracy • measure accuracy with standard 5-fold cross validation
  21. Birdsong and machine learning • results: – to the Jupyter

    notebook  – https://github.com/NickleDave/ML-comparison- birdsong/
  22. Python in Neuroscience, part II • Frontiers in Neuroinformatics (open

    access): http://dx.doi.org/10.3389/fninf.2015.00011 – bioinformatics • protein networks in Alzheimer’s – neuroimaging – stimulus generation for: • psychophysics • electrophysiology – modeling / simulation • NEURON,NEST,PCSIM,Brian,MOOSE,NENGO
  23. Python in Neuroscience, part II • Binder ZOMG SO COOL

    – http://mybinder.org/ – http://mybinder.org/repo/sofroniewn/tactile- coding