15.053 Network Simplex Animations Network Simplex Animations.
How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press),...
-
Upload
harvey-emery-george -
Category
Documents
-
view
241 -
download
1
Transcript of How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press),...
![Page 1: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/1.jpg)
How To Do Multivariate Pattern Analysis
![Page 2: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/2.jpg)
What is MVPA?
Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments
![Page 3: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/3.jpg)
V1 V2 V3 V4 V5 V6
V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6
AverageAverage
Not significant
—
Individually not significant…but significant when consideredin conjunction!
Univariate vs. multivariate analysis of fMRI data
![Page 4: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/4.jpg)
Univariate analysis:
Fusiform face area
Significant?
Multivariate patternanalysis: Predictable?
Primary visual cortex
V1 V2 V3 V4 V5 V6
The direction in which the correlation between the perceptual stimuli and brain activity is mapped does not matter from a
statistical point of view.
Multivariate pattern analysis:Reverse inference
![Page 5: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/5.jpg)
Classifier
? ? ? ? ? ? ? ? ? ? ? ?V1 activitypattern
vvvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv v
Testing trials
Classifier guess
Stimulus
Performance: 75%Stimulus
V1 activitypattern
vvvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv v
Testing trials
vvvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv vv
vvvv
vv v
Stimulus
V1 activitypattern
Training trials
![Page 6: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/6.jpg)
1 2 3 4 5 6 7 8
12
3
4
5
6
7
8
Runs
Cro
ss-v
alid
atio
n st
eps
Training run Testing run
Performance 1
Performance 2
Performance 3
Performance 4
Performance 5
Performance 6
Performance 7
Performance 8
Overall performance
Cross-validation paradigm:
![Page 7: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/7.jpg)
What do I need to do MVPA? An fMRI experiment with an appropriate design Almost any modern computer PyMVPA software
![Page 8: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/8.jpg)
Experiment designAs many trials as possible to train the classifier
![Page 9: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/9.jpg)
Experiment design
As many trials as possible to train the classifierClear 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
![Page 10: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/10.jpg)
Sparse temporal sampling
Video clip TR
![Page 11: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/11.jpg)
What is the input to the classifier?
Raw fMRI data
TR TR TR TR TR TR TR TRTR TRTR TR
TASK A TASK B
![Page 12: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/12.jpg)
What is the input to the classifier?
Raw fMRI data Averaged fMRI data
TR TR TR TR TR TR TR TRTR TRTR TR
TASK A TASK B
AVG AVG
![Page 13: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/13.jpg)
What is the input to the classifier?
Raw fMRI data Averaged fMRI data beta values from a GLM analysis
TR TR TR TR TR TR TR TRTR TRTR TR
TASK A TASK B
![Page 14: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/14.jpg)
Data pre-processing
• Motion-correction• Smoothing (?)• Trend removal / high pass filter• Z-scoring PyMVPA
FSL
![Page 15: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/15.jpg)
Gathering Your Tools
![Page 16: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/16.jpg)
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
![Page 17: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/17.jpg)
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.)
![Page 18: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/18.jpg)
Brief python demo Python command line Python scripting iPython
![Page 19: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/19.jpg)
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
![Page 20: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/20.jpg)
Gather Your Ingredients
![Page 21: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/21.jpg)
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
![Page 22: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/22.jpg)
Sample preprocessing script
![Page 23: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/23.jpg)
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
![Page 24: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/24.jpg)
dog violin cow vase
VOLUMES
VOXELS
Terminology
![Page 25: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/25.jpg)
dog violin cow vase
SAMPLES
FEATURES
TARGETS
CHUNK
Terminology
![Page 26: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/26.jpg)
Sample attributes file
Sparse design Block design
![Page 27: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/27.jpg)
Getting started with pymvpa
Start python or ipython Import the pymvpa module and explore it
![Page 28: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/28.jpg)
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)
![Page 29: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/29.jpg)
Getting started with pymvpa
Read in your attributes
Create a dataset
![Page 30: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/30.jpg)
Mappers Mappers transform data samples Dataset automatically maps data from 4D to 2D Many mappings are reversible
![Page 31: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/31.jpg)
Data pre-processing steps
Detrending
Z-scoring
![Page 32: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/32.jpg)
Partitioners Used to split the data into training set and testing set
HalfPartitioner() OddEvenPartitioner() NFoldPartitioner()
![Page 33: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/33.jpg)
Choosing a classifier algorithm
• Nearest neighbor• Support Vector Machine (SVM)• Linear Discriminant Analysis (LDA)• Gaussian Naive Bayes (GNB)• Sparse Multinomial Linear Regression (SMLR)•...•...
![Page 34: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/34.jpg)
Choosing a classifier algorithm
![Page 35: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/35.jpg)
Support Vector Machine Draws a hyperplane to separate the categories,
maximizing the margin between classes
![Page 36: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/36.jpg)
Support Vector Machine
![Page 37: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/37.jpg)
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)
![Page 38: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/38.jpg)
Misaki et al, 2010, NeuroImage
![Page 39: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/39.jpg)
Choosing a classifier algorithm
![Page 40: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/40.jpg)
Setting up cross-validation
![Page 41: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/41.jpg)
Go!
![Page 42: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/42.jpg)
Results
Show confusion matrix:
Plot confusion matrix:
![Page 43: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/43.jpg)
Significance testing
• Binomial test
• Permutation testing
• Voxel sensitivity maps
![Page 44: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/44.jpg)
Significance testing
• Binomial test
![Page 45: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/45.jpg)
Significance testing
• Binomial test
![Page 46: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/46.jpg)
Significance testing
• Permutation testing• Generate a null distribution by randomly permuting pattern
labels
http://www.pymvpa.org/examples/permutation_test.html
![Page 47: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/47.jpg)
Searchlight analysis
![Page 48: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/48.jpg)
Searchlight analysis
![Page 49: How To Do Multivariate Pattern Analysis. What is MVPA? Animations from Meyer & Kaplan (in press), Journal of Visualized Experiments.](https://reader035.fdocuments.net/reader035/viewer/2022081504/56649e2d5503460f94b1c6f8/html5/thumbnails/49.jpg)
To study on your own
Temporal exploration: averaging, temporal searchlights Sensitivity maps Permutation testing