64
Multivoxel pattern-based real-time fMRI Stephen LaConte Virginia Tech Carilion Research Institute School of Biomedical Engineering and Sciences

Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Multivoxel pattern-based real-time fMRI

Stephen LaConte

Virginia Tech Carilion Research InstituteSchool of Biomedical Engineering and Sciences

Page 2: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Multivoxel pattern-based real-time fMRI

• Conceptual overview

• Experimental flexibility

• Practicalities and additional resources

Page 3: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

This week

• This evening: lecture

• Wednesday evening: rtfMRI demo

• Thursday lab: Optional lab on classifiers

Page 4: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Classification in Real Time

LaConte et al. Hum Brain Mapp (2007)

Page 5: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Conceptual overview

Page 6: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Brain State Classification

x1 x2

.

.

.

x2

x1

time

experiment

Page 7: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

x g

high dimensional input space

scalar (or verylow dimensional)

decision

Classifier

Classification

Page 8: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Linear Discriminant Analysis

UTxx z g

PCA rotation based on training data

feature space vector

linear weights from eigenvectors of class covariances

high dimensional input space

reduceddimensionalfeature space

scalar (or verylow dimensional)

decision

Lz

Page 9: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Data Matrix:

Truncate Q (model complexity)

PCA via SVD:

CVA:

time

voxe

ls

Columns of L are determined by the eigenvectors of W-1B. W is the within class variance and B the between class variance, and both are obtained from Z.

X

Linear Discriminant Analysis

Page 10: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Support Vector Machine

k(x)x z .w zw z g

non-linear kernel mapping function

feature space vector

linearweights

high dimensional input space

very highdimensionalfeature space

scalar decision

Page 11: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

minimize

This term allows some training errors. This term favors the widest possible margin,

C = infinity is hard margin SVM (as apposed to soft margin)because it does not allow any training errors

SVM

Page 12: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Nonlinear Decision Boundary

Page 13: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

4-Class Model

1

34

2

Multi-classIndividual 2-class models

1 vs. 4 2 vs. 4 1 vs. 3

1 vs. 22 vs. 33 vs. 4

Page 14: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Temporal Regression

time

fMRI experimenty

1

63

9

10

8

6

4

2

0

10

8

6

4

2

0

0)( ββ += Txxf

))(,( xfyL

1x

2x y

1x2x

Page 15: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Predicting Network Time Series

Craddock, R.C. et al. OHBM 2012.

Network Template

Training Data

Spatial Regression

Network Time Series

SVRTraining

Testing Data

SVR Model

Network Time SeriesSVR Model

Page 16: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Pattern-based rtfMRI

Page 17: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Image Reconstruction

Image DataData Acquisition

Stimulus Presentation

Stimulus

Conventional FMRI

Test Data Classifier Output

Testing Run

LaConte, et al. (2007) Hum Brain Mapp. 28: 1033-1044

Pattern-based rtfMRI

Exp. Design

Class Training Labels

Training run

Time-LabeledScans

SVM Classification

Page 18: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

LaConte, NeuroImage (2011)

Network configuration

Page 19: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Stimulus seen by volunteerUpdated fMRI

results Motion tracking and correction

Intensity (brightness) of a single pixel, changing during stimulus conditions

Controller interface for some display parameters

Page 20: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Z.S.S Aug-18

The AFNI interface

Slide provided by Ziad Saad

Page 21: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Multivoxel pattern-based real-time fMRI

• Conceptual overview

• Experimental flexibility

• Practicalities and additional resources

Page 22: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Flexibility of brain state classification

With the exact same experimental setup (different instructions), subjects can learn to move the arrow

LaConte, et al. (2007) Hum Brain Mapp

Page 23: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Cigarette craving

In collaboration with Pearl Chiu

Covert counting rate

Experimental flexibility:Task appropriate interfaces

Page 24: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

neurofeedback controling events

Experimental flexibility:Support vector regression of RSNs

Page 25: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

with Shashank Priya and Read Montague

Experimental flexibility:Brain Machine Interfaces

Page 26: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Experimental flexibility:Brain Machine Interfaces

Page 27: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Support Vector Machine Maps of Real-Time Tasks

Z=31Z=8

Y=15

Z=0

X=-5

Right vs. Left Tapping Fast vs. Slow Counting Crave vs. Don’t Crave

Page 28: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Do feedback runs differ from no-feedback runs?

(LaConte, et al. HBM, 2007)

Page 29: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Support Vector Machine Maps of Real-Time Tasks

Z=31Z=8

Y=15

Z=0

X=-5

Right vs. Left Tapping Fast vs. Slow Counting Crave vs. Don’t Crave

Page 30: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Papageorgiou, et al.PNAS, 2013.

Speech: Covert countingClassification accuracy

Page 31: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Speech: Covert countingΔ PA

Δ SNR

30

25

20

15

10

5

-5

-10

-15

-0.2 -0.1 0.1 0.2 0.3 0.4

z=3 z=41 x=48Papageorgiou, et al.PNAS, 2013.

Page 32: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Support Vector Machine Maps of Real-Time Tasks

Z=31Z=8

Y=15

Z=0

X=-5

Right vs. Left Tapping Fast vs. Slow Counting Crave vs. Don’t Crave

Page 33: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Frontoparietal

With Feedback

Without Feedback

With Feedback

Without Feedback

Low accuracy subjects

High accuracy subjects

Page 34: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Multivoxel pattern-based real-time fMRI

• Conceptual overview

• Experimental flexibility

• Practicalities and additional resources

Page 35: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Computational considerations

Equation [2] is not well suited for real-time FMRI…As the number of images grows (i.e., as the vectors increase in dimension), the amount of calculation will grow. In a real-time application, this is unacceptable, because at some point the computer will not be able to finish processing a new image before the next one is ready.

First real-time FMRI (Cox et al., 1995), developed a recursive partial correlation algorithm.

Page 36: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Computational considerations• Real-time classification

• Train with a deterministic algorithm

• Training is computationally intensive but highly doable• Converge “immediately” after scan

• Classify on an image-by-image basis

Page 37: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Basic Benchmarks

• Classifier safety factor > 20,000x. – Approximately 1µsec / dot product.

• Network/AFNI Transfers > 20x volumes– Approximately 100 µsec / slice to transfer

Page 38: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

3dsvm Plugin ScreenshotSupport Vector Machine Analysis

Page 39: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

3dsvm

• 3dsvm is a command line program and plugin for AFNI, built around SVM-Light. It provides the ability to analyze functional magnetic resonance imaging (fMRI) data as described in (LaConte et al., 2005)

• lacontelab.org/3dsvm.html

Page 40: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

3dsvm features• Distributed with AFNI• Reading AFNI-supported formats (including NIfTI)

• Thus all preprocessing and data manipulation of the major software packages

• Masking of variables (brain pixels)• Censoring training samples• Visualizing alphas as time series and linear weight

vectors as functional maps• Multi-class classification• Regression• Support for non-linear kernels

Page 41: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

• Prepare training and test data sets– fMRI (3D+t)– Labels (1D) – labels for test data are optional (needed to to calculate

accuracy)– Mask for training data (3D) – 3dsvm considers mask to be part of the

model it generates• 3dsvm training

– Creates a model that can be tested with independent data– For convenience, inspecting the model

• Model alphas (1D) • Weight vector map (3D)

• 3dsvm testing– Calculates class and/or distance measure for each new timepoint– Prediction accuracy (if test set labels are available)

3dsvm tour: basic steps

Page 42: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

3dsvm Plugin SnapshotSupport Vector Machine Analysis

training

testing

Page 43: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Training - 3dsvm -trainvol run1+orig \-trainlabels run1_categories.1D \-mask mask+orig \-model model_run1

Testing - 3dsvm -testvol run2+orig \-model model_run1+orig \-predictions pred2_model1

Command Line

Page 44: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Example:Left vs. Right visual stimulus• 3T fmri 31 axial EPI slices, TR/TE = 2000/31 msec, voxel=3.4 X 3.4 X 4 mm).• Randomized block lengths alternating between left and right stimulus.

Page 45: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Example:Left vs. Right visual stimulus• 3T fmri 31 axial EPI slices, TR/TE = 2000/31 msec, voxel=3.4 X 3.4 X 4 mm).• Randomized block lengths alternating between left and right stimulus.

Page 46: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Example:Left vs. Right visual stimulus• 3T fmri 31 axial EPI slices, TR/TE = 2000/31 msec, voxel=3.4 X 3.4 X 4 mm).• Randomized block lengths alternating between left and right stimulus.

Page 47: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Example:Left vs. Right visual stimulus• 3T fmri 31 axial EPI slices, TR/TE = 2000/31 msec, voxel=3.4 X 3.4 X 4 mm).• Randomized block lengths alternating between left and right stimulus.

Page 48: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Bimanual coordination task:Feedback of both the left and right hand performance was provided by a four arc display described in (Klaiman and Karniel, 2006), where button tapping was used to move the inner arches to match the speed of the outer arches.

1:1 – Good Performance

00.5

11.5

2

0 100 200 300 400 500 600

But

ton

Tapp

ing

Rat

io

Time (s)

Stimulus Presentation

1:1 – Poor Performance

3:2 – Good Performance

3:2 – Poor Performance

Example Stimulus Framesexample 2

Page 49: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

3:2 (red) vs. 1:1 (blue)p=0.001

1:1 (red) vs. Fixation (blue)FDR-corrected; q<0.01

3:2 (red) vs. Fixation (blue)FDR-corrected; q<0.01

Group brain maps of the SVM models for the 14 subjects

Distributed pattern for 1:1 & 3:2 rhythms: Bil. Precuneus (BA7) L. (1:1) & Bil. (3:2) postcentral (BA4)Bil. LentiformR. culmen

Distributed pattern during Fixation: L. cuneus (BA18)

Distributed pattern unique to 1:1 rhythm: Bil. Precentral/M1 (BA4) R. inf. Temporal (BA37)L. sup. Parietal

Distributed pattern unique to 3:2 rhythm: R. middle frontal (BA6)L. medial frontal (BA6)

Raw classifier output plotted over label files for a relatively accurate subject. The first two TRs have been removed for each transition between stimuli.

1:1 vs. Fixation(93% Accuracy)

3:2 vs. Fixation(93% Accuracy)

3:2 vs. 1:1(77% Accuracy)

example 2

Page 50: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh# example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 51: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 52: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

Page 53: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 54: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 55: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 56: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

example 2

Page 57: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

#!/bin/csh # example by Prashant Prasad

3dsvm -trainvol volreg_run1_PPA+orig \-trainlabels LABEL_PPA_1.1D \-mask automask_run1_PPA+orig \-bucket bucket_run1_PPA \-model model_run1_PPA

3dsvm -classout \-testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1_classout

3dsvm -testvol volreg_run2_PPA+orig \-testlabels LABEL_PPA_2.1D \-model model_run1_PPA+orig \-predictions pred_run2_frmRun1

1:1 vs. Fixation(93% Accuracy)

3:2 vs. Fixation(93% Accuracy)

3:2 vs. 1:1(77% Accuracy)

Page 58: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Demonstration ExperimentInitial scans----------------------------------------------• Localizer (9 seconds)

• Anatomical scan (4.5 minutes)

LaConte, NeuroImage (2011)

fMRI runs---------------------------------------------• Masking run (10 seconds)

• Training run (6 minutes)

• Feedback run (6 minutes)

Page 59: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Setting up AFNI's RT plugin• Manually

– Good for learning and demo

Slide provided by Ziad Saad

Page 60: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Setting up AFNI's RT plugin• Via Environment Variables

setenv AFNI_REALTIME_Registration 3D:_realtimesetenv AFNI_REALTIME_Graph Realtime

Slide provided by Ziad Saad

Page 61: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

AFNI help resources• Readme files

– README.driver– README.environment– README.realtime

• Demo material available on: http://afni.nimh.nih.gov

• Automation– @DriveAfni script– @DriveSuma script– @DO.examples

• Sample programs– rtfeedme.c– Dimon.c– serial_helper.c– realtime_receiver.py

Slide provided by Ziad Saad

Page 62: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

MVPA Resources (1)Reading• Norman et al. 2006. Beyond mind-reading: multi-voxel pattern analysis of fMRI data.

Trends in Cognitive Sciences. 10:424-430.• Mitchell, et al. 2004. Learning to decode cognitive states from brain images. Machine

Learning. 57:145-175.• Strother, et al. 2002. The quantitative evaluation of functional neuroimaging experiments:

The NPAIRS data analysis framework. NeuroImage. 15:747-771. • LaConte, S., Strother, S., Cherkassky, V., Anderson, J. and Hu, X., 2005. Support vector

machines for temporal classification of block design fMRI data. NeuroImage, 26(2), pp.317-329.

• LaConte, S.M., Peltier, S.J. and Hu, X.P., 2007. Real‐time fMRI using brain‐state classification. Human brain mapping, 28(10), pp.1033-1044.

• Pereira, F., Mitchell, T. and Botvinick, M., 2009. Machine learning classifiers and fMRI: a tutorial overview. Neuroimage, 45(1), pp.S199-S209.

Page 63: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

MVPA Resources (2)Software:• MVPA: http://www.csbmb.princeton.edu/mvpa/• PyMVPA: http://pkg-exppsy.alioth.debian.org/pymvpa/• 3dsvm: http://lacontelab.org/3dsvm.html• NPAIRS: http://code.google.com/p/plsnpairs/• Searchmight: http://minerva.csbmb.princeton.edu/searchmight/• Python machine learning package for neuroimaging: https://nilearn.github.io/• Python package for Neural Networks on GPU: https://www.tensorflow.org/ • Python package for Neural Networks on GPU: https://pytorch.org/

Online course:• Coursera.org machine learning class by Andrew Ng:

https://www.coursera.org/learn/machine-learning

Page 64: Multivoxel pattern-based real-time fMRI · 2018-08-14 · Multivoxel pattern-based real-time fMRI. Stephen LaConte. Virginia Tech Carilion Research Institute. School of Biomedical

Multivoxel pattern-based real-time fMRI• Conceptual overview

– Supervised learning for fMRI • (classification and regression)

– Integration with MRI and real-time platforms• Experimental flexibility

– Whole-brain models trained to the distributed patterns of each individual for neurofeedback, BCIs, adaptive fMRI paradigms, etc.

– Feedback improves classifications• Employs frontoparietal networks

• Practicalities and additional resources– 3dsvm and AFNI’s realtime plugin