1 / 49

How To Do Multivariate Pattern Analysis

How To Do Multivariate Pattern Analysis. What is MVPA?. Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments. Not significant. Average. Average. V 1. V 2. V 3. V 4. V 5. V 6. V 1. V 2. V 3. V 4. V 5. V 6. Univariate vs. multivariate analysis of

barid
Download Presentation

How To Do Multivariate Pattern Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How To Do Multivariate Pattern Analysis

  2. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments

  3. Not significant Average Average V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6 Univariate vs. multivariate analysis of fMRI data Individually not significant… but significant when considered in conjunction! — V1 V2 V3 V4 V5 V6

  4. Fusiform face area Significant? Univariate analysis: Multivariate pattern analysis: Reverse inference The direction in which the correlation between the perceptual stimuli and brain activity is mapped does not matter from a statistical point of view. Primary visual cortex Multivariate pattern analysis: Predictable? V1 V2 V3 V4 V5 V6

  5. Training trials Stimulus v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v V1 activity pattern v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v v Stimulus v v v v v v v v v v v v Performance: 75% v v v v v v V1 activity pattern v v v v v v v v v v v v v v v v v v Classifier Testing trials ? ? ? ? ? ? ? ? ? ? ? ? Classifier guess V1 activity pattern Stimulus Testing trials

  6. Cross-validation paradigm: 1 2 3 4 5 6 7 8 Runs 1 Cross-validation steps Performance 1 2 Performance 2 3 Performance 3 Overall performance 4 Performance 4 5 Performance 5 6 Performance 6 7 Performance 7 8 Performance 8 Training run Testing run

  7. What do I need to do MVPA? • An fMRI experiment with an appropriate design • Almost any modern computer • PyMVPA software

  8. Experiment design • As many trials as possible to train the classifier

  9. Experiment design • As many trials as possible to train the classifier • Clear BOLD pattern resulting from each trial TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR TR

  10. Sparse temporal sampling Video clip TR

  11. What is the input to the classifier? TR TR TR TR TR TR TR TR TR TR TR TR TASK A TASK B • Raw fMRI data

  12. What is the input to the classifier? TR TR TR TR TR TR TR TR TR TR TR TR TASK A TASK B • Raw fMRI data • Averaged fMRI data AVG AVG

  13. What is the input to the classifier? TR TR TR TR TR TR TR TR TR TR TR TR TASK A TASK B • Raw fMRI data • Averaged fMRI data • beta values from a GLM analysis

  14. Data pre-processing • Motion-correction • Smoothing (?) • Trend removal / high pass filter • Z-scoring PyMVPA FSL

  15. Gathering Your Tools

  16. Why PyMVPA • Alternative toolbox: Princeton MVPA toolbox http://code.google.com/p/princeton-mvpa-toolbox/ • PyMVPA is free and open-source, does not require Matlab • Well-maintained and flexible • Python is great once you get used to it • I know how to use it

  17. Python • An interpreted, modern programming language • Produces very clear, easy to read code • Object-oriented • Extensive scientific computing modules available for python (scipy, nipy, etc.)

  18. Brief python demo • Python command line • Python scripting • iPython

  19. Gathering Your Tools • Install PyMVPA: http://www.pymvpa.org • Version .4x versus .6x • Linux: Very easy, just type one command • Windows: • Mac: Instructions on website will only install .4x. To install .6x follow my guide: • http://www.jonaskaplan.com/lab/pymvpainstallation.php

  20. Gather Your Ingredients

  21. Ingredients • 1 4-dimensional functional data file, motion-corrected • This should be all of your data from one subject. If you did multiple scans, concatenate them into one single 4D file, all motion corrected to the same volume

  22. Sample preprocessing script

  23. Ingredients • 1 4-dimensional functional data file, motion-corrected • This should be all of your data from one subject. If you did multiple scans, concatenate them into one single 4D file, all motion corrected to the same volume • 1 text file which contains “attributes”: • Column 1 labels each volume with a “target” category • Column 2 labels each volume with a “chunk”, e.g. scan • 1 Mask file in the functional space

  24. Terminology VOLUMES violin dog vase cow VOXELS

  25. Terminology SAMPLES TARGETS dog violin vase cow FEATURES CHUNK

  26. Sample attributes file Block design Sparse design

  27. Getting started with pymvpa • Start python or ipython • Import the pymvpa module and explore it

  28. Sample dataset • Subject saw nine different 5-second video clips: dog, cow, rooster, violin, piano, bass, vase, chainsaw, coins • One single volume acquired 7 seconds after the start of the clip • Eight scans, each stimulus seen 3 times in each scan (24 times across the experiment)

  29. Getting started with pymvpa • Read in your attributes • Create a dataset

  30. Mappers • Mappers transform data samples • Dataset automatically maps data from 4D to 2D • Many mappings are reversible

  31. Data pre-processing steps • Detrending • Z-scoring

  32. Partitioners • Used to split the data into training set and testing set • HalfPartitioner() • OddEvenPartitioner() • NFoldPartitioner()

  33. Choosing a classifier algorithm • Nearest neighbor •  Support Vector Machine (SVM) •  Linear Discriminant Analysis (LDA) •  Gaussian Naive Bayes (GNB) •  Sparse Multinomial Linear Regression (SMLR) • ... • ...

  34. Choosing a classifier algorithm

  35. Support Vector Machine • Draws a hyperplane to separate the categories, maximizing the margin between classes

  36. Support Vector Machine

  37. Support Vector Machine • Draws a hyperplane to separate the categories, maximizing the margin between classes • Works quickly with on large feature sets (lots of voxels) • Common in fMRI pattern learning literature • Binary classifier • Linear version chosen (very little advantage to nonlinear SVM with lots of features and few stimuli)

  38. Misaki et al, 2010, NeuroImage

  39. Choosing a classifier algorithm

  40. Setting up cross-validation

  41. Go!

  42. Results Show confusion matrix: Plot confusion matrix:

  43. Significance testing • Binomial test • Permutation testing • Voxel sensitivity maps

  44. Significance testing • Binomial test

  45. Significance testing • Binomial test

  46. Significance testing • Generate a null distribution by randomly permuting pattern labels http://www.pymvpa.org/examples/permutation_test.html • Permutation testing

  47. Searchlight analysis

  48. Searchlight analysis

  49. To study on your own • Temporal exploration: averaging, temporal searchlights • Sensitivity maps • Permutation testing

More Related